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 can I round to whole numbers in JavaScript?

I have the following code to calculate a certain percentage: var x = 6.5; var total; total = x/15*100; // Result 43.3333333333 What I want …

javascript operators rounding
How do I round a number in JavaScript?

While working on a project, I came across a JS-script created by a former employee that basically creates a report …

javascript floating-point numbers rounding
How to round up in c#

I want to round up always in c#, so for example, from 6.88 to 7, from 1.02 to 2, etc. How can I do …

c# rounding
How can I round up the time to the nearest X minutes?

Is there a simple function for rounding UP a DateTime to the nearest 15 minutes? E.g. 2011-08-11 16:59 becomes 2011-08…

c# datetime rounding
How to get excel to display a certain number of significant figures?

I am using excel and i want to display a value to a certain number of significant figures. I tried …

excel spreadsheet rounding significant-digits
Round up a CGFloat in Swift

How can I round up a CGFloat in Swift? I've tried ceil(CDouble(myCGFloat)) but that only works on iPad …

swift rounding cgfloat ceil
How do I format a double to currency rounded to the nearest dollar?

Right now I have double numba = 5212.6312 String.Format("{0:C}", Convert.ToInt32(numba) ) This will give me $5,213.00 but I don't want …

c# formatting rounding currency
How to round up to the nearest 10 (or 100 or X)?

I am writing a function to plot data. I would like to specify a nice round number for the y-axis …

r rounding
JavaScript: Round to a number of decimal places, but strip extra zeros

Here's the scenario: I'm getting .9999999999999999 when I should be getting 1.0. I can afford to lose a decimal place of precision, …

javascript math floating-point rounding
Rounding time in Python

What would be an elegant, efficient and Pythonic way to perform a h/m/s rounding operation on time related …

python datetime time modulo rounding