2016-04-15 23:56:44 +08:00
---
2016-05-27 11:48:08 +08:00
order: 3
2016-08-18 15:59:07 +08:00
title:
zh-CN: 小数
en-US: Decimals
2016-04-15 23:56:44 +08:00
---
2016-04-15 23:39:39 +08:00
2016-08-18 15:59:07 +08:00
## zh-CN
和原生的数字输入框一样, value 的精度由 step 的小数位数决定。
## en-US
2016-08-18 15:46:11 +08:00
A numeric-only input box whose values can be increased or decreased using a decimal step. The number of decimals (also known as precision) is determined by the step prop.
2016-04-15 23:39:39 +08:00
````jsx
import { InputNumber } from 'antd';
function onChange(value) {
console.log('changed', value);
}
ReactDOM.render(
2016-12-03 14:44:10 +08:00
< InputNumber min = {0} max = {10} step = {0.1} onChange = {onChange} / >
2016-04-15 23:39:39 +08:00
, mountNode);
````