int32.ToString()

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

I have in a int32 a value and a want to show it in a label in this format:
1,234. I know there is an overload to the ToString method who has a string
format. Which is string to see the numbers with the comma in the thousands?

Thank you.
 
Hi Alberto,

Try with "#,##0".
Note that the thousands separator character depends on the culture.
You might use InvariantCulture to be on the safe side:
i.ToString("#,##0", CultureInfo.InvariantCulture)
 
Back
Top