xianniu-ui 0.8.11 → 0.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xianniu-ui.common.js +27 -25
- package/lib/xianniu-ui.umd.js +27 -25
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/utils/math.js +4 -2
package/package.json
CHANGED
package/src/utils/math.js
CHANGED
|
@@ -22,11 +22,13 @@ class Math {
|
|
|
22
22
|
const fieldKey = args[1]
|
|
23
23
|
return list.map(item => item[fieldKey]).reduce((pre, cur) => {
|
|
24
24
|
let val = new Decimal(pre - 0)
|
|
25
|
-
|
|
25
|
+
const res = val[this.type](new Decimal(cur - 0)).toFixed(2)
|
|
26
|
+
return new Decimal(res).toNumber()
|
|
26
27
|
})
|
|
27
28
|
} else {
|
|
28
29
|
return args.reduce((pre, cur) => {
|
|
29
|
-
|
|
30
|
+
const res = new Decimal(pre - 0)[this.type](new Decimal(cur - 0)).toFixed(2)
|
|
31
|
+
return new Decimal(res).toNumber()
|
|
30
32
|
})
|
|
31
33
|
}
|
|
32
34
|
}
|