In C#, is it possible to perform ToString on a float and get the value without using exponentials?
For example, consider the following:
float dummy;
float dummy = 0.000006F;
Console.WriteLine(dummy.ToString("0." + new string('#', 60)));
If you'll be doing this a lot then it makes sense to store the format string in a static
field/property somewhere and re-use it, rather than constructing a new string
every time:
private static readonly string _allFloatDigits = "0." + new string('#', 60);
// ...
float dummy = 0.000006F;
Console.WriteLine(dummy.ToString(_allFloatDigits));