round
Import from @varavel/vdl-plugin-sdk/utils/math.
Rounds a number to a specified precision.
This function takes a number and an optional precision value, and returns the number rounded to the specified number of decimal places.
Parameters
| Parameter | Type | Description |
|---|---|---|
value |
number |
The number to round. |
precision? |
number |
The number of decimal places to round to. Defaults to 0. |
Returns
number
The rounded number.
Throws
Throws an error if Precision is not integer.