取整

function ceilNumber(n) {

    let b = 0;
    if (n < 10) {
        return 10;
    }
    while(n>=10) {
        n /= 10
        b += 1
    }
    return Math.ceil(n) * Math.pow(10, b)

}
原文地址:https://www.cnblogs.com/Running00/p/15381006.html