Utils.round()
Return the number given as first parameter rounded with the number of decimals given as second parameter
Parameters
Name | Type | Description | |
---|---|---|---|
1 | x | number | |
2 | decimals | number |
Return value
number
the result
Usage
import {Utils} from '@lcluber/type6js';
let number = 2.568995;
let round = Utils.round(number, 2);
console.log(round); //(2.57)