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.

How do you round a floating point number in Perl?

How can I round a decimal number (floating point) to the nearest integer? e.g. 1.2 = 1 1.7 = 2

perl floating-point rounding
Java Round up Any Number

I can't seem to find the answer I'm looking for regarding a simple question: how do I round up any …

java math int rounding
How to get a float result by dividing two integer values using T-SQL?

Using T-SQL and Microsoft SQL Server I would like to specify the number of decimal digits when I do a …

sql-server sql-server-2008 division rounding
Get decimal portion of a number with JavaScript

I have float numbers like 3.2 and 1.6. I need to separate the number into the integer and decimal part. For example, …

javascript floating-point numbers decimal rounding
Why does Math.Round(2.5) return 2 instead of 3?

In C#, the result of Math.Round(2.5) is 2. It is supposed to be 3, isn't it? Why is it 2 instead in …

.net rounding
Rounding a double to turn it into an int (java)

Right now I'm trying this: int a = round(n); where n is a double but it's not working. What am …

java double int rounding
How do you round a float to 2 decimal places in JRuby?

How do you round a float to 2 decimal places in JRuby(1.6.x)? number = 1.1164 number.round(2) # The above shows the following …

ruby jruby rounding
Rounding to two decimal places in Python 2.7?

Using Python 2.7 how do I round my numbers to two decimal places rather than the 10 or so it gives? print "…

python python-2.7 rounding
round() doesn't seem to be rounding properly

The documentation for the round() function states that you pass it a number, and the positions past the decimal to …

python floating-point rounding
Rounding numbers to 2 digits after comma

I have no idea how to do this? I'm adding comma numbers, result is of course always a number with …

javascript math rounding