roundTo
Rounds a number to specified decimal places
Available since v1.9.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | number | The number to round |
decimals | number | Number of decimal places |
Returns
Section titled “Returns”number — Rounded number
Examples
Section titled “Examples”Round to 2 decimal places
Section titled “Round to 2 decimal places”Rounds a floating-point number to the specified number of decimals.
Round to 0 decimal places
Section titled “Round to 0 decimal places”Effectively rounds to the nearest integer.
