Created
March 27, 2016 13:45
-
-
Save Fhernd/b98eca7ba72a588d18cb to your computer and use it in GitHub Desktop.
Redondear número decimal a dos posiciones de precisión.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Articulo.Pregunta.P1720 | |
{ | |
public class FormatoDecimal | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine (); | |
// Definición variable decimal: | |
decimal valor = 951753456.951753456M; | |
Console.WriteLine (valor); | |
Console.WriteLine (); | |
Console.WriteLine (valor.ToString("#.##")); | |
Console.WriteLine (String.Format("{0:0.00}", valor)); | |
Console.WriteLine (valor.ToString("N2")); | |
Console.WriteLine ("{0:C}", valor); | |
Console.WriteLine (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello my name is keisa,its give me please to write you after going through your profile i will like to be in communication with you kindly write me(keisafreya@yahoo.co.uk) for a deal. thanks