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)
// → 4Round to two decimal places.
round(2.555,2)
// → 2.56Interfaces
The same operation is available through the interfaces below.
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
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | The expression to round. |
n | ExpressionInput | The number of decimal places to round. Defaults to 0. |
Returns
Expression — The rounded value of x.
