Format float value to exponential form
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
float value = 123456.123456F;
string specifier;
CultureInfo culture;
specifier = "E04";
culture = CultureInfo.CreateSpecificCulture("sv-SE");
Console.WriteLine(value.ToString(specifier, culture));
culture = CultureInfo.CreateSpecificCulture("en-NZ");
Console.WriteLine(value.ToString(specifier, culture));
}
}
//1,2346E+005
//1.2346E+005
Related examples in the same category