In India and other Asian countries money is formatted as following: The first three digits grouped in three then all other digits are grouped in pair of two. eg : 2,54,255.12 5,22,54,255.12 etc string money = String.Format("{0:#,##0.00}", 254255.12);
gives the output 254,255.12
but the output required is 2,54,255.12
Use an appropriate CultureInfo and the "c" format specifier:
CultureInfo hindi = CultureInfo.CreateSpecificCulture("hi-IN");
string text = string.Format(hindi, "{0:c}", 254255.12);
Note that you should really use decimal rather than double for currency values, to avoid binary floating point issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With