positive decimal number in string Format code example
Example 1: string format comma c#
String.Format("{0:n}", 1234); // Output: 1,234.00
String.Format("{0:n0}", 9876); // No digits after the decimal point. Output: 9,876
Example 2: vb.net tostring numeric format string
decimal value = 123.456m;
Console.WriteLine("Your account balance is {0:C2}.", value);
// Displays "Your account balance is $123.46."