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.

Java - Decimal Format.parse to return double value with specified number of decimal places

I want to be able to convert a string to a Double given a number of decimal places in a …

java parsing decimal rounding decimalformat
Why does .NET use banker's rounding as default?

According to the documentation, the decimal.Round method uses a round-to-even algorithm which is not common for most applications. So …

.net rounding
How do I round a number in JSTL?

I'm doing a division in a JSP and I'd like to round the result - how should I do this? …

math jsp jstl el rounding
Discard millisecond part from timestamp

How can I discard/round the millisecond part, better if the second part is also removed from a timestamp w/…

sql postgresql casting timestamp rounding
C++ round a double up to 2 decimal places

I am having trouble rounding a GPA double to 2 decimal places. (ex of a GPA needed to be rounded: 3.67924) I …

c++ rounding cin ceil
Round up to nearest multiple of five in PHP

I want a php function which returns 55 when calling it with 52. I've tried the round() function: echo round(94, -1); // 90 It …

php function rounding
PHP How do I round down to two decimal places?

I need to round down a decimal in PHP to two decimal places so that: 49.955 becomes... 49.95 I have tried number_…

php decimal rounding number-formatting
Java: round to nearest multiple of 5 (either up or down)

I need to round a number to nearest multiple of 5 (either up or down). For example, here are the list …

java rounding
Difference between toFixed() and toPrecision()?

I'm new to JavaScript and just discovered toFixed() and toPrecision() to round numbers. However, I can't figure out what the …

javascript rounding precision
How to use expr on float?

I know it's really stupid question, but I don't know how to do this in bash: 20 / 30 * 100 It should be 66.67 but …

bash floating-point rounding fixed-point