Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

How to round down to 2 decimals a float using Python?

How to round down to 2 decimals a float using Python?                               


1 Answer
Jayashree

Python's round() function requires two arguments. First is the number to be rounded. Second argument decides the number of decimal places to which it is rounded. To round the number to 2 decimals, give second argument as 2. If third digit after decimal point is greater than 5, last digit is increased by 1.

>>> round(1.4756,2)
1.48
>>> round(1.3333,2)
1.33
Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.