mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
修改格式化人数算法
This commit is contained in:
@@ -405,19 +405,26 @@ export function translate(field) {
|
||||
/**格式化人数的文档 ,学习人数,关注人数等*/
|
||||
export function formatUserNumber(num) {
|
||||
let rsNum =0;
|
||||
return num;
|
||||
if(num<95){
|
||||
if(num<5){return 0;}
|
||||
if(num>=5 && num<= 10){return 10 +"+";}
|
||||
if(num<=94){
|
||||
rsNum=Math.round((num)/10)*10;
|
||||
return rsNum+'+';
|
||||
}
|
||||
if(num>94){
|
||||
rsNum=Math.round((num+50)/100)*100;
|
||||
if(num>94 && num <= 1000){
|
||||
rsNum=Math.round((num)/100)*100;
|
||||
return rsNum+'+';
|
||||
}
|
||||
if(num>1000 && num <= 10000){
|
||||
rsNum=Math.round((num)/1000)*1000;
|
||||
return rsNum+'+';
|
||||
}
|
||||
if(num>10000){
|
||||
rsNum=Math.round((num)/10000)*10000;
|
||||
return rsNum+'+';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//你加了,线上直接报出来了
|
||||
//alert(formatUserNumber(99));
|
||||
|
||||
/**
|
||||
* 将秒转换成小时
|
||||
|
||||
Reference in New Issue
Block a user