mirror of https://github.com/ElemeFE/element
parent
d8002ccb07
commit
af0dc358bc
|
@ -195,7 +195,7 @@
|
|||
methods: {
|
||||
toPrecision(num, precision) {
|
||||
if (precision === undefined) precision = this.numPrecision;
|
||||
return parseFloat(Number(num).toFixed(precision));
|
||||
return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
|
||||
},
|
||||
getPrecision(value) {
|
||||
if (value === undefined) return 0;
|
||||
|
|
Loading…
Reference in New Issue