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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xianniu-ui",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
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
- return val[this.type](new Decimal(cur - 0)).toNumber()
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
- return new Decimal(pre - 0)[this.type](new Decimal(cur - 0)).toNumber()
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
  }