This commit is contained in:
prefert 2019-06-28 12:59:51 +08:00
parent 3fce7cc644
commit 7a0a979506

View file

@ -186,8 +186,13 @@
}, },
precisionValue () { precisionValue () {
// can not display 1.0 // can not display 1.0
if(!this.currentValue) return this.currentValue; // if(!this.currentValue) return this.currentValue;
return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue; // return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
let arr = (this.currentValue + '').split('.');
if (this.precision && arr[1] && this.precision < arr[1].length) {
return this.currentValue.toFixed(this.precision);
}
return this.currentValue;
}, },
formatterValue () { formatterValue () {
if (this.formatter && this.precisionValue !== null) { if (this.formatter && this.precisionValue !== null) {