roundTo
Commons
stable
Round a number to a given number of decimal places using the standard half-up rule.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- valuerequirednumber
- The number to round.
- placesnumber0
- The number of decimal places to keep. Defaults to 0 (integer rounding).
API
Return value
The value returned by this util.
- The rounded number.
Usage
Examples
Ready-to-paste usage snippets.
Integer and decimal rounding