Here's my code:
x = 1.0
y = 100000.0
print x/y
My quotient displays as 1.00000e-05
Is there any way to suppress scientific notation and make it display as
0.00001? How to convert the scientific notation into float.
Thanks in advance.
This feels somewhat ridiculous to ask but I haven't figured out
a way to do it yet. I'm going to use the result as a string.
解决方案'%f' % (x/y)
but you need to manage precision yourself. e.g.,
'%f' % (1/10**8)
will display zeros only.
details are in the docs