roundValue
roundValue(value: number, decimals?: number): number;
Round a number to a specified number of decimal places. If decimals is not provided, the default precision (DEFAULT_PRECISION) is used.
| Parameter | Type | Description |
|---|---|---|
value | number | The number to round |
decimals | number (optional) | Number of decimal places (defaults to DEFAULT_PRECISION) |
Example
// Round to 2 decimal places
soundManager.roundValue(3.14159, 2); // 3.14
// Round with default precision
soundManager.roundValue(3.14159); // 3.14 (or whatever DEFAULT_PRECISION is)