Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting currency in .NET

I am formatting the currency using Tostring() method i m using following syntax

ToString('##.##') it is working perfectly but in case of round number it remove last 2 zero

like for 100 it does not show 100.00 is shows 100.

how can i format in that way means input desired output 100 100.00 100.10 100.10

like image 692
Pradeep Gaur Avatar asked Dec 01 '25 14:12

Pradeep Gaur


1 Answers

Try "##.00" instead.

That will force two digits after the decimal separator.

You can also use ToString("C") to use the culture specific format in Windows directly.

like image 172
Øyvind Bråthen Avatar answered Dec 03 '25 03:12

Øyvind Bråthen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!