You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
730 B

---
order: 3
title:
zh-CN: 高精度小数
en-US: High precision decimals
---
9 years ago
## zh-CN
通过 `stringMode` 开启高精度小数支持,`onChange` 事件将返回 string 类型。对于旧版浏览器,你需要 BigInt polyfill。
## en-US
Use `stringMode` to support high precision decimals support. `onChange` will return string value instead. You need polyfill of BigInt if browser not support.
9 years ago
```tsx
9 years ago
import { InputNumber } from 'antd';
function onChange(value: string) {
9 years ago
console.log('changed', value);
}
ReactDOM.render(
<InputNumber<string>
style={{ width: 200 }}
defaultValue="1"
min="0"
max="10"
step="0.00000000000001"
onChange={onChange}
stringMode
/>,
mountNode,
);
```