In PHP I have the following code:
<?PHP $var = .000021; echo $var; ?>
the output is 2.1E-5 !
Why? it should print .000021
(1) Right-click a cell where you want to remove scientific notation, and (2) choose Format Cells… 2. In the Format Cells window, (1) select the Number category, (2) set the number of decimal places to 0, and (3) click OK. Now the scientific notation is removed.
There is a simple technique to suppress scientific notation when using float values by using the %f flag in string. This will convert the number into a floating-point number and then print it.
Use number_format() to get what you're after:
print number_format($var, 5);
Also check sprintf()
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