How do you use the "round" function to round off numbers to desired decimal places? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you use the "round" function to round off numbers to desired decimal places?

11th Dec 2019, 9:16 AM
Chukwunonso Emmanuel Chukwumaeze
Chukwunonso Emmanuel Chukwumaeze - avatar
2 Answers
+ 1
round(number, decimal_points) Example: print(round(1234.56789, 3))
11th Dec 2019, 9:58 AM
Ipang
+ 1
Thanks
11th Dec 2019, 10:16 AM
Chukwunonso Emmanuel Chukwumaeze
Chukwunonso Emmanuel Chukwumaeze - avatar