我怎样才能将这个数字四舍五入到最接近的 10,000?

How can I round this number up to the nearest 10,000th?

所以,我想将输出四舍五入到最接近的 10,000(输出将以小数形式打印)。但是,当我使用 round() 时,没有任何反应。我应该在我的代码中更改什么才能打印正确的输出?

编辑 所以这是我的代码输出

2.4586597040905134

我希望输出看起来是一样的,但四舍五入到第 10,000 位所以,我希望输出看起来像这样,

2.45866

就像我使用 round() 时一样,出现了相同的 2.4586597040905134。此断言的语法是否有任何问题?

阅读docs

见下文

num = 2.4586597040905134
num = round(num,5)
print(num)

输出

2.45866