Advertisement
Fhernd

FormatoDecimal.cs

Mar 27th, 2016
7,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Articulo.Pregunta.P1720
  4. {
  5.     public class FormatoDecimal
  6.     {
  7.         public static void Main()
  8.         {
  9.             Console.WriteLine ();
  10.            
  11.             // Definición variable decimal:
  12.             decimal valor = 951753456.951753456M;
  13.             Console.WriteLine (valor);
  14.            
  15.             Console.WriteLine ();
  16.            
  17.             Console.WriteLine (valor.ToString("#.##"));
  18.             Console.WriteLine (String.Format("{0:0.00}", valor));
  19.             Console.WriteLine (valor.ToString("N2"));
  20.             Console.WriteLine ("{0:C}", valor);
  21.            
  22.             Console.WriteLine ();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement