Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
i am using

decimal amount = 394049494;
string stramount = amount.ToString("##,##,##,###");
Console.WriteLine (stramount);

but the output is
394,049,494

what is the reason. Plz help
Posted

1 solution

Try specifying the culture to one using two-digit separation:

C#
CultureInfo ci = new CultureInfo("hi-IN");
stramount = amount.ToString("##,##,##,###", ci);
Console.WriteLine(stramount);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900