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.

Why does .NET decimal.ToString(string) round away from zero, apparently inconsistent with the language spec?

I see that, in C#, rounding a decimal, by default, uses MidpointRounding.ToEven. This is expected, and is what the …

c# decimal tostring number-formatting rounding
Django ORM how to Round an Avg result

I have a model in which I use Django ORM to extract Avg of values from the table. I want …

django orm model rounding average
Gaussian/banker's rounding in JavaScript

I have been using Math.Round(myNumber, MidpointRounding.ToEven) in C# to do my server-side rounding, however, the user needs …

javascript rounding
Rounded Form with System Shadow

I tried to do with SetWindowRgn, and I couldn't. Can do that (the top 2 corners are rounded, the window has …

forms delphi shadow rounding region
Java. How to disable rounding in DecimalFormat

Can I disable rounding "feature" in DecimalFormat? For example: DecimalFormat f = new DecimalFormat(); f.parseObject("123456789012345.99"); Result is 1.2345678901234598E14 java version "1.6.0_21"

java rounding decimalformat
Common strategies to deal with rounding errors in currency-intensive soft?

What is your advice on: compensation of accumulated error in bulk math operations on collections of Money objects. How is …

algorithm numbers rounding finance
rounding to an arbitrary number of significant digits in javascript is not working

I tried below sample code function sigFigs(n, sig) { if ( n === 0 ) return 0 var mult = Math.pow(10, sig - Math.floor(…

javascript rounding significant-digits
Fixing Sub-Pixel rounding issue in a CSS Fluid Grid

I'm trying to create a fluid CSS grid, it works in Firefox and IE8+ but NOT in Safari/Chrome/Opera …

javascript css rounding fluid-layout subpixel
CSS calc() rounding

This problem is similar to Chrome 37 calc rounding But the real problem was a bit more complicated, and the solution …

css rounding css-calc
0.1 float is greater than 0.1 double. I expected it to be false

Let: double d = 0.1; float f = 0.1; should the expression (f > d) return true or false? Empirically, the answer is true. …

c++ c floating-point double rounding