ant-design/components/input-number/demo/digit.md

27 lines
555 B
Markdown
Raw Normal View History

2016-04-15 23:56:44 +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
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
2017-01-19 15:19:03 +08:00
````__react
2016-04-15 23:39:39 +08:00
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);
````