@augment-vir/common
Version:
A collection of augments, helpers types, functions, and classes for any JavaScript environment.
23 lines (22 loc) • 584 B
TypeScript
/**
* Round a value to the given number of decimal digits. If no decimal value is present, no rounding
* occurs.
*
* @category Number
* @category Package : @augment-vir/common
* @example
*
* ```ts
* 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});
* ```
*
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
*/
export declare function round(value: number, { digits }: {
digits: number;
}): number;