@momo-kits/foundation 0.168.1-beta.5 → 0.168.1-beta.6

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.
@@ -32,6 +32,7 @@ import {
32
32
  } from './common';
33
33
  import { InputMoneyProps } from './index';
34
34
  import styles from './styles';
35
+ import { formatNumberToMoney } from './utils';
35
36
  import SystemTextInput from './SystemTextInput';
36
37
 
37
38
  // Finds the common prefix and suffix of `old` and `text`; `size` counts the
@@ -137,9 +138,7 @@ const InputMoney = forwardRef(
137
138
  }, [caretSelection]);
138
139
 
139
140
  const updateDisplayValue = (numeric: string) => {
140
- // Group the digit string directly: Number() loses precision past 15
141
- // digits and switches to "1e+21" notation past 20.
142
- const formatted = numeric.replace(/\B(?=(\d{3})+(?!\d))/g, '.');
141
+ const formatted = numeric ? formatNumberToMoney(Number(numeric)) : '';
143
142
  const next = formatted ? `${formatted}${currency}` : '';
144
143
  setDisplayValue(next);
145
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.168.1-beta.5",
3
+ "version": "0.168.1-beta.6",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},