Utils.trunc()

Return the number given as first parameter truncated with the number of decimals given as second parameter

Parameters

NameTypeDescription
1xnumber
2decimalsnumber

Return value

number

the result

Usage

import {Utils} from '@lcluber/type6js';

let number = 2.563995;
let trunc = Utils.trunc(number, 2);
console.log(trunc); //(2.56)