If you used big float numbers , you found in C# big float number is showed like this :
2000000 * 2000000 = 4E+12
How can I show 4E+12 as 4,000,000,000,000 not 4E+12 ?
the character "E" means 200 zeros after the "."
Floating-point decimal values generally do not have an exact binary representation. This is a side effect of how the CPU represents floating point data. For this reason, you may experience some loss of precision, and some floating-point operations may produce unexpected results.
In computers, floating-point numbers are represented in scientific notation of fraction ( F ) and exponent ( E ) with a radix of 2, in the form of F×2^E . Both E and F can be positive as well as negative. Modern computers adopt IEEE 754 standard for representing floating-point numbers.
You want
number.ToString("N0");
"N0" is Number with no decimal places.
The alternative - "F0" is Fixed-point with no decimal places but prints without the comma separators:
double number = 4e12;
Console.WriteLine(number.ToString("F0"));
Console.WriteLine(number.ToString("N0"));
prints:
4000000000000
4,000,000,000,000
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With