You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
507 B

2 years ago
export default {
convertW (e) {
if(!e||isNaN(Number(e))) return '0'
let a = Number(e).toFixed(0)
return a.length<=4?e.toFixed(2):a.length<8? (e/10000).toFixed(2)+'W':a.length>=8?(e/10000000).toFixed(2)+'KW':e.toFixed(2)
// if(a.length<=4){
// return e.toFixed(2)
// }
// else if (a.length<8){
// return (e/10000).toFixed(2)+'W'
// }
// else if (a.length>=8){
// return (e/10000000).toFixed(2)+'KW'
// }
// else {
// return e.toFixed(2)
// }
},
}