-4

How to suppress scientific notation from a float value in python. Here I tried the following code but it's not working

r_val[v].append('%.2f' % val.get("closing_balance"))

Thanks in advance

Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
Charles Michel
  • 194
  • 2
  • 17

1 Answers1

1

Using format(x, '.#f')

consider this snippet:

x = 0.000000235
print(x)
2.35e-07
print (format(x, '.9f'))
0.000000235

Or, to go closer to your question:

y = -1.06267582739e-11  # note I changed '+' to '-' since '+' is is just represented as a regular float

    print(y)
    -1.06267582739e-11

    print(format(y,'.22f'))
    -0.0000000000106267582739
CIsForCookies
  • 12,097
  • 11
  • 59
  • 124