11,581 questions
Check an example:
var c = CultureInfo.GetCultureInfo( "en-IN" );
decimal n = 1122450;
string s = n.ToString( "#,0", c );
Console.WriteLine( s ); // "11,22,450"
Use the language name which is more appropriate.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
int number = 25226;
string abc = string.Format("{0:#,0}", number);
abc = string.Format("{0:#,0}", 1122450); //1,122,450
when i applied this format for million value string.Format("{0:#,0}", 1122450); then output comes like 1,122,450 which is not right. so tell me best format which works fine for thousand and million value. thanks
Check an example:
var c = CultureInfo.GetCultureInfo( "en-IN" );
decimal n = 1122450;
string s = n.ToString( "#,0", c );
Console.WriteLine( s ); // "11,22,450"
Use the language name which is more appropriate.