I want to add a comma in the thousands place for a number.
String.Format()
?
Answer
String.Format("{0:n}", 1234); // Output: 1,234.00 String.Format("{0:n0}", 9876); // No digits after the decimal point. Output: 9,876
Online Free Tutorials Guruji Guide & Materials – Solved Questions Answers
I want to add a comma in the thousands place for a number.
String.Format()
?
String.Format("{0:n}", 1234); // Output: 1,234.00 String.Format("{0:n0}", 9876); // No digits after the decimal point. Output: 9,876