Top "Rounding" questions

Rounding a numerical value means replacing it by another value that is approximately equal but has a shorter, simpler, or more explicit representation.

Limiting floats to two decimal points

I want a to be rounded to 13.95. >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999 The round function does …

python floating-point rounding precision
Round to at most 2 decimal places (only if necessary)

I'd like to round at most 2 decimal places, but only if necessary. Input: 10 1.7777777 9.1 Output: 10 1.78 9.1 How can I do this in …

javascript rounding decimal-point
How to round a number to n decimal places in Java

What I would like is a method to convert a double to a string which rounds using the half-up method …

java decimal rounding digits
Round a double to 2 decimal places

If the value is 200.3456, it should be formatted to 200.34. If it is 200, then it should be 200.00.

java double rounding
Show a number to two decimal places

What's the correct way to round a PHP string to two decimal places? $number = "520"; // It's a string from a database $…

php formatting numbers rounding number-formatting
SQL - Rounding off to 2 decimal places

I need to convert minutes to hours, rounded off to 2 decimal places.I also need to display only up to 2 …

sql rounding
How do you round UP a number in Python?

This problem is killing me. How does one roundup a number UP in Python? I tried round(number) but it …

python floating-point integer rounding python-2.x
How to round to 2 decimals with Python?

I am getting a lot of decimals in the output of this code (Fahrenheit to Celsius converter). My code currently …

python rounding
Formatting a number with exactly two decimals in JavaScript

I have this line of code which rounds my numbers to two decimal places. But I get numbers like this: 10.8, 2.4, …

javascript rounding decimal-point
Truncate (not round) decimal places in SQL Server

I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example: …

sql sql-server tsql rounding