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.

Formatting Decimal places in R

I have a number, for example 1.128347132904321674821 that I would like to show as only two decimal places when output to …

r formatting rounding r-faq
Converting a float to a string without rounding it

I'm making a program that, for reasons not needed to be explained, requires a float to be converted into a …

python string floating-point rounding
converting double to integer in java

In Java, I want to convert a double to an integer, I know if you do this: double x = 1.5; int …

java casting double rounding
Round double in two decimal places in C#?

I want to round up double value in two decimal places in c# how can i do that? double inputValue = 48.485; …

c# double rounding
How do you round to 1 decimal place in Javascript?

Can you round a number in javascript to 1 character after the decimal point (properly rounded)? I tried the *10, round, /10 but …

javascript rounding
C++: How to round a double to an int?

I have a double (call it x), meant to be 55 but in actuality stored as 54.999999999999943157 which I just realised. So …

c++ floating-point rounding
round() for float in C++

I need a simple floating point rounding function, thus: double round(double); round(0.1) = 0 round(-0.1) = 0 round(-0.9) = -1 I can …

c++ floating-point rounding
How to round float numbers in javascript?

I need to round for example 6.688689 to 6.7, but it always shows me 7. My method: Math.round(6.688689); //or Math.round(6.688689, 1); //or …

javascript rounding
Round a Floating Point Number Down to the Nearest Integer?

As the title suggests, I want to take a floating point number and round it down to the nearest integer. …

python floating-point integer rounding