取整

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)

}
posted @ 2021-10-08 17:47  Running00  阅读(99)  评论(0)    收藏  举报