0

I want to print the whole number instead of 1e-06

number = 1

result = number/1000000

print(result)

Please help whats the best way to do it?

martineau
  • 119,623
  • 25
  • 170
  • 301

2 Answers2

1

Try out the following by using format:

number = 1
result = number/1000000
print('{0:.6f}'.format(result))

Output:

0.000001
Code Pope
  • 5,075
  • 8
  • 26
  • 68
0

output = f"{num:.9f}"

you can replace 9 with the amount of numbers you have after the decimal point in your number.

and also you will need to define your variable to float to order it will work.

marksman123
  • 389
  • 2
  • 11