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 to properly round up half float numbers in Python?

I am facing a strange behavior of the round() function: for i in range(1, 15, 2): n = i / 2 print(n, "=>", round(…

python python-3.x floating-point rounding precision
Round a float up to the next integer in javascript

I need to round floating point numbers up to the nearest integer, even if the number after the point is …

javascript floating-point rounding
Math.round() and Math.floor() problem with setInterval()

I'm having problem with Math.round() and Math.floor() in setInterval() function by using jQuery. This is my code: var …

jquery math setinterval rounding floor
Round to nearest five

I need to round a double to nearest five. I can't find a way to do it with the Math.…

c# double rounding
How to truncate a BigDecimal without rounding

After a series of calculations in my code, I have a BigDecimal with value 0.01954 I then need to multiply this …

java rounding bigdecimal arithmeticexception
round number to 2 decimal places

I need to round a number to two decimal places. Right now the following rounds to the nearest integer I …

tcl rounding
Rounding integers to nearest multiple of 10

I am trying to figure out how to round prices - both ways. For example: Round down 43 becomes 40 143 becomes 140 1433 becomes 1430 …

c# currency rounding
R round to nearest .5 or .1

I have a data set of stock prices that have already been rounded to 2 decimal places (1234.56). I am now trying …

r rounding r-faq
Make a button round

I'm trying to make a JButton round at the (x,y) coordinates of (150,210). I want the button to be an …

java swing jbutton rounding
Round with integer division

Is there is a simple, pythonic way of rounding to the nearest whole number without using floating point? I'd like …

python rounding integer-division