numeral-react

1.0.0 • Public • Published

numeral-react

It is a very tiny component which is a replacement of HTML input element for post-editing format of number values.

ex. 1000000 -> 1,000,000

react-numeral-input

Dependency

Install

yarn add numeral numeral-react

Usage

<NumeralReact
  onChange={(event, value) => {
    console.info(value)
  }}
/>

Options

You can set any original input props such as format and onChange. For example:

<NumeralReact className="" placeholder="" format="0,0" onChange={onChange} />
  • format: string

Default: "0,0"

It is passed to configure numeral format, You can find more information from Numeral.js.

  • onChange: function(event: React.ChangeEvent, value: number)

Callback when value is changed, you will receieve unformated number (1000000 instead of 1,000,000).

Package Sidebar

Install

npm i numeral-react

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

20.2 kB

Total Files

13

Last publish

Collaborators

  • mkeskin