Home
> Development > C# Two Decimal Places Format String
C# Two Decimal Places Format String
Needed this today. I never remember format strings.
String.Format("{0:0.00}", 123.4567); // "123.46" String.Format("{0:0.00}", 123.4); // "123.40" String.Format("{0:0.00}", 123.0); // "123.00"
Hope this helps.
Blair..
Categories: Development
.NET, C#, Samples, Snippets
Comments (0)
Trackbacks (0)
Leave a comment
Trackback