

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to round down to 2 decimals a float using Python?
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
- Related Questions & Answers
- Java Program to round number to fewer decimals
- How to round down to nearest integer in MySQL?
- How do you round up a float number in Python?
- How can I round down a number in JavaScript?
- How to round off a floating number using Python?
- How to convert amount to float and round correctly in PHP?
- Round number down to nearest power of 10 JavaScript
- How to format a rounded number to N decimals using JavaScript?
- Round float and double numbers in Java
- How to select/get drop down option in Selenium 2?
- How to round off a number in Python?
- How to list down all the files alphabetically using Python?
- Dividing a floating number, rounding it to 2 decimals, and calculating the remainder in JavaScript
- How to round MySQL column with float values and display the result in a new column?
- How to convert float to integer in Python?
Advertisements