Search code examples
antd

InputNumber for a currency input?


I need a currency amount input. Is there anyway to customize the InputNumber to support things like commas (',') or $?

Similar to these:

http://leonardowf.github.io/react-simple-currency/

https://github.com/jsillitoe/react-currency-input

I'm using form and InputNumber right now but it is hard to read (for the user) without at least the commas per thousand:

<Col span='24'>
   <FormItem label='Original Investment'>
         {getFieldDecorator('originalInvestment', {
           rules: [{ required: true, message: 'Please input your Investment!' }],
           initialValue: 100000000
         })(
            <InputNumber min={100000000} max={10000000000} />
         )}
   </FormItem>
</Col>

Solution

  • It is not supported yet, you can trace https://github.com/ant-design/ant-design/issues/4681