+ 1

How to limit the output of a float to three digits after the point???

16th Nov 2016, 9:19 PM
Yasmine
Yasmine - avatar
4 Answers
+ 2
nvm!! figured it out :)
16th Nov 2016, 9:49 PM
Yasmine
Yasmine - avatar
+ 1
round off
16th Nov 2016, 9:21 PM
Sajjad ahmad
Sajjad ahmad - avatar
+ 1
uhh.. sorry still don't get it..
16th Nov 2016, 9:46 PM
Yasmine
Yasmine - avatar
+ 1
print("{0:.3f}".format(number))
16th Nov 2016, 9:49 PM
Demeth
Demeth - avatar