Change string format

Hello!

How can i change the format of a string this type “3146.24” to “3,146.24”?

Hi
try this.
String.Format("{0:n}", 3146.24)

Hi,

Another solution:

Double.Parse("3146.24").ToString("N2")

Regards,

Great!

What is “N2”?

Hi,

It’s standard numeric format string. Please see the following document in details.

Regards,

Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.