I'm currently multiplying two floats like so: 0.0004 * 0.0000000000012 = 4.8e-16
How do I get the result in a normal format, i.e. without the scientific notation, something like 0.0000000000324 and then round it up to say 5 numbers.
Summary: Use the string literal syntax f"{number:. nf}" to suppress the scientific notation of a number to its floating-point representation.
How do you stop e+ in Python? Use a string literal to suppress scientific notation Use the string literal syntax f"{num:. nf}" to represent num in decimal format with n places following the decimal point.
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.
You can use string formatting.
a = 0.0004 * 0.0000000000012 # => 4.8e-16
'%.5f' % a # => "0.00000"
pi = Math::PI # => 3.141592653589793
'%.5f' % pi # => "3.14159"
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