Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Placeholder numérico: #
- Console.WriteLine(12.345.ToString(".##"));
- Console.WriteLine(12.345.ToString(".####"));
- // Placeholder con cero:
- Console.WriteLine(12.345.ToString(".00"));
- Console.WriteLine(12.345.ToString(".0000"));
- // Separador de grupos: ,
- Console.WriteLine(1234.ToString("#,###,###"));
- Console.WriteLine(1234.ToString("0,000,000"));
- // Multiplicador: ,
- Console.WriteLine(1000000.ToString("#,"));
- Console.WriteLine(1000000.ToString("#,,"));
- // Notación porcentual: ,
- Console.WriteLine(0.6.ToString("00%"));
- // Notación exponencial:
- Console.WriteLine(1234.ToString("0E0"));
- Console.WriteLine(1234.ToString("0E+0"));
- Console.WriteLine(1234.ToString("0.00E00"));
- Console.WriteLine(1234.ToString("0.00e00"));
- // Carácter de escape: \
- Console.WriteLine(50.ToString(@"\#0"));
- // Cadena literal con comillas: 'xx' 'xx'
- Console.WriteLine(50.ToString("0 '...'"));
- // Separador de sección: ;
- Console.WriteLine(15.ToString("#;(#);cero"));
- Console.WriteLine((-15).ToString("#;(#);cero"));
- Console.WriteLine(0.ToString("#;(#);cero"));
- // Cualquier otro carácter:
- Console.WriteLine(35.2.ToString("$0 . 00c"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement