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

Time:11-06

So, I want to round the output to the nearest 10,000th (the output will be printed in decimals). However, when I used round(), nothing happened. What should I change in my code so that it prints the right output?

Edit So this is my output from the code

2.4586597040905134

and what I want the output to look like is the same thing but rounded to the 10,000th place so, I want the output should look like this,

2.45866

Like when I used round(), the same 2.4586597040905134 came up. Are there any issues with syntax for assertion for this?

CodePudding user response:

Read the docs

See below

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

output

2.45866
  • Related