SOURCE

const toRound = (num,floor) => {

    return Math.round(num/floor) * floor
}

const toRound2 = (num,floor) => {

    return Math.ceil(num/floor) * floor
}

console.log(toRound2(1001,100))
console 命令行工具 X clear

                    
>
console