Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created March 27, 2016 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/b98eca7ba72a588d18cb to your computer and use it in GitHub Desktop.
Save Fhernd/b98eca7ba72a588d18cb to your computer and use it in GitHub Desktop.
Redondear número decimal a dos posiciones de precisión.
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 ();
}
}
}
@keisabably
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment