Decimal format in texboxes

  • Thread starter Thread starter crop
  • Start date Start date
C

crop

i need to show in textboxes data from dataset with databinding.
i have decimal number = "2390,00" and a want to this number looks like
"2 390,00", when i have "3909877,00" i want "2 909 877,00"
how do that?
 
Hi,
decimal i = Convert.ToDecimal("3909877,00") ;
i = i/100;
NumberFormatInfo info = new System.Globalization.CultureInfo( "en-US",
false ).NumberFormat;
info.NumberGroupSeparator = " ";

Hope this helps you..
Regards,
Sambathraj
string requiredText = i.ToString("N",info).Replace(".",",");
 
Back
Top