计算数字

This commit is contained in:
daihh
2022-10-14 21:37:59 +08:00
parent 5e633f5867
commit e7b0132a3a
2 changed files with 27 additions and 9 deletions

View File

@@ -264,7 +264,7 @@ export function getUType(type) {
return name;
}
/**此方法的意义,需要一起讨论*/
export function experienceValue(total) {
let data = {
start:'',
@@ -324,8 +324,8 @@ export function experienceValue(total) {
data.endValue = 30000;
data.percentage = parseFloat((total / 30000) * 100);
}
console.log("&&&&&&&&&&&&&&&&&&&&&&&");
console.log(data);
//console.log("&&&&&&&&&&&&&&&&&&&&&&&");
//console.log(data);
return data;
}
export function translate(field) {
@@ -340,3 +340,20 @@ export function translate(field) {
}
return name;
}
/**格式化人数的文档 ,学习人数,关注人数等*/
export function formatUserNumber(num) {
let rsNum =0;
if(num<5){
return 0;
}
if(num<95){
rsNum=Math.round((num+5)/10)*10;
return rsNum+'+';
}
if(num>94){
rsNum=Math.round((num+50)/100)*100;
return rsNum+'+';
}
return 0;
}