Commit af0dc358 authored by susiwen8's avatar susiwen8 Committed by iamkun

Input-Number: Fix precision problem (#15292) (#15295)

parent d8002ccb
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment