mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
计算数字
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user