Function reference · Math

round

Rounds a number to a requested number of decimal places.

With no second argument, round uses integer precision. An optional integer precision selects decimal places. Symbolic values or unsupported precisions remain symbolic.

Examples

These examples use Nerdamer Notation.

Round to the nearest integer.

round(3.7)
// → 4

Round to two decimal places.

round(2.555,2)
// → 2.56

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

round(arg1, [arg2])

nerdamer.round

Call the operation through the default nerdamer import.

nerdamer.round(x: ExpressionInput, n?: ExpressionInput): Expression

Parameters

NameTypeDescription
xExpressionInputThe expression to round.
nExpressionInputThe number of decimal places to round to. Defaults to `0`.

Returns

Expression — The rounded value of `x`.

Browse the nerdamer API →

← Back to Reference