Wednesday, March 28, 2012

String.Format comma for thousands and two decimal points only

I am trying to come up with theString.Format expression to format a number that will have a comma to separate the thousands and a period for the decimals ( I want to show only two decimals )

Will this work for you?

String.Format("{0:N2}", MyNumber)

0 comments:

Post a Comment