Round a value to the given number of decimal digits. If no decimal value is present, or if undefined digits are given, no rounding occurs.
undefined
The number of digits to round to. Set to undefined to disable rounding.
import {round} from '@augment-vir/common';// `result1` is `5.13`const result1 = round(5.125, {digits: 2});// `result2` is `5`const result2 = round(25, {digits: 2}); Copy
import {round} from '@augment-vir/common';// `result1` is `5.13`const result1 = round(5.125, {digits: 2});// `result2` is `5`const result2 = round(25, {digits: 2});
@augment-vir/common
Round a value to the given number of decimal digits. If no decimal value is present, or if
undefined
digits are given, no rounding occurs.