round

round(x)

round(x, n)

round(unit, valuelessUnit)

round(unit, n, valuelessUnit)

Try it yourself:

See also:

round(): Rounding to a Nearby Value

round() rounds a number to the nearest integer or requested precision. It is useful for display values, reports, and deliberately discrete calculations.

Choose a rounding rule

Tie behavior matters, so test values exactly halfway between choices when financial or regulatory results depend on it. Use floor() to always round down, ceil() to always round up, and fix() to move toward zero.

Round at the presentation boundary whenever possible. Premature rounding compounds errors in totals, ratios, and iterative calculations. Use format() when only the displayed number of digits should change.

Try Round in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions