数组格式化

function formatViewNum(num){
    if(parseInt(num) > 10000){
        return parseFloat(num / 10000).toFixed(1)+"";
    }else if(parseInt(num) > 10000){
        return parseFloat(num / 1000).toFixed(1)+"";
    }else{
        return parseInt(num)
    }
}

 

posted @ 2018-01-02 10:50  邹柯  阅读(1339)  评论(0编辑  收藏  举报