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.

Double value to round up in Java

I have a double value = 1.068879335 i want to round it up with only two decimal values like 1.07. I tried like …

java double rounding numberformatexception
Truncate Two decimal places without rounding

Lets say I have a value of 3.4679 and want 3.46, how can I truncate to two decimal places that without rounding …

c# math rounding
How might I convert a double to the nearest integer value?

How do you convert a double into the nearest int?

c# rounding
How to resolve a Java Rounding Double issue

Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*…

java math rounding
How to round a Double to the nearest Int in swift?

I'm trying to make a calculator of growth rate (Double) that will round the result to the nearest Integer and …

swift int double rounding
How to round down to nearest integer in MySQL?

How would I round down to the nearest integer in MySQL? Example: 12345.7344 rounds to 12345 mysql's round() function rounds up. I …

mysql sql rounding
how to always round up to the next integer

i am trying to find total pages in building a pager on a website (so i want the result to …

c# language-agnostic rounding
Rounding integer division (instead of truncating)

I was curious to know how I can round a number to the nearest whole number. For instance, if I …

c math int rounding integer-division
Rounding float in Ruby

I'm having problems rounding. I have a float, which I want to round to the hundredth of a decimal. However, …

ruby-on-rails ruby rounding
Javascript: formatting a rounded number to N decimals

in JavaScript, the typical way to round a number to N decimal places is something like: function roundNumber(num, dec) { …

javascript math rounding decimal-point