Format float with Fixed-point format specifier f3 in CSharp
Description
The following code shows how to format float with Fixed-point format specifier f3.
Example
//from w w w.j a v a 2s . c om
using System;
class MainClass {
public static void Main() {
float myFloat = 1234.56789f;
string myString8 = String.Format("{0, 10:f3}", myFloat);
Console.WriteLine("String.Format(\"{0, 10:f3}\", myFloat) = " + myString8);
}
}
The code above generates the following result.