Python如何获取0.000001而不是1e-06 [重复]

我要打印整个数字而不是1e-06

number = 1

result = number/1000000

print(result)

请帮助做什么的最好方法是什么?

评论
She
She

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

you can replace 9 with the amount of numbers you have on your number.

点赞
评论
She
She

Try out the following by using format:

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

输出:

0.000001
点赞
评论