|
|
@@ -211,8 +211,23 @@
|
|
|
option && jobPie.setOption(option)
|
|
|
},
|
|
|
calculatedPercentage(up, down){
|
|
|
- // console.log((up*100/down).toFixed(2),(up/down).toFixed(2)*100,'(up/down).toFixed(2)')
|
|
|
- return (up*100/down).toFixed(2)
|
|
|
+ console.log(typeof (up*100/down),'(up/down).toFixed(2)')
|
|
|
+ if(down !== 0){
|
|
|
+ let a = (up*100/down).toFixed(2)
|
|
|
+
|
|
|
+ if(this.isInfinit(a)){
|
|
|
+ return '0.00'
|
|
|
+ }else{
|
|
|
+ return a
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ return '0.00'
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ isInfinit(num) {
|
|
|
+ return isNaN(num) || Math.abs(num) === Infinity;
|
|
|
}
|
|
|
}
|
|
|
}
|