StringBuilder AppendFormat() method to add a formatted string containing a floating point number to myStringBuilder
using System;
using System.Text;
class Test {
public static void Main() {
StringBuilder myStringBuilder = new StringBuilder();
float myFloat = 1234.56789f;
myStringBuilder.AppendFormat("{0, 10:f3}", myFloat);
Console.WriteLine("myStringBuilder = " + myStringBuilder);
}
}
Related examples in the same category