function truncInteger(number, precision) {
return number - (number % precision);
}
console.log(truncInteger(1000040, 100));
console.log(truncInteger(1200040, 100));
function roundInteger(number, precision) {
return Math.round(number / precision) * precision;
}
console.log(roundInteger(1000040, 100));
console.log(roundInteger(1200040, 100));
console.log(roundInteger(1000080, 100));
console.log(roundInteger(1200080, 100));