{"id":22986681,"url":"https://github.com/mkg0/react-numeric","last_synced_at":"2025-07-04T09:38:13.612Z","repository":{"id":44977755,"uuid":"122636795","full_name":"mkg0/react-numeric","owner":"mkg0","description":"A react component for formatted number form fields","archived":false,"fork":false,"pushed_at":"2022-12-07T19:57:34.000Z","size":1867,"stargazers_count":34,"open_issues_count":26,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-27T12:16:19.090Z","etag":null,"topics":["currency","formatter","input","localization","money","number","numeric","reactjs"],"latest_commit_sha":null,"homepage":"https://mkg0.github.io/react-numeric/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkg0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-23T15:13:57.000Z","updated_at":"2023-03-20T11:24:25.000Z","dependencies_parsed_at":"2023-01-24T22:00:20.772Z","dependency_job_id":null,"html_url":"https://github.com/mkg0/react-numeric","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/mkg0/react-numeric","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkg0%2Freact-numeric","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkg0%2Freact-numeric/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkg0%2Freact-numeric/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkg0%2Freact-numeric/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkg0","download_url":"https://codeload.github.com/mkg0/react-numeric/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkg0%2Freact-numeric/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262725213,"owners_count":23354432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["currency","formatter","input","localization","money","number","numeric","reactjs"],"created_at":"2024-12-15T03:51:16.132Z","updated_at":"2025-07-04T09:38:13.581Z","avatar_url":"https://github.com/mkg0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-numeric\n\n[![npm](https://img.shields.io/npm/l/react-numeric.svg?style=flat-square)]()\n[![npm](https://img.shields.io/npm/v/react-numeric.svg?style=flat-square)](https://www.npmjs.com/package/react-numeric)\n\n\nA react component for formatted number form fields\n\u003e react-numeric is a wrapper component for [autonumeric](https://github.com/autoNumeric/autoNumeric).\n\n## Installition\n\n```sh\nyarn add react-numeric\n# or\nnpm install react-numeric --save\n```\n\n## Usage\n\n```jsx\nimport ReactNumeric from 'react-numeric';\n\nexport function USDMoneyInput(props){\n  const { value } = props; // number typed\n  return (\n    \u003cReactNumeric\n      value={value}\n      currencySymbol=\"$\"\n      minimumValue=\"0\"\n      decimalCharacter=\".\"\n      digitGroupSeparator=\"\"\n      onChange={(event, value)=\u003e{\n        console.log(event.target.value); // '1,234.5 $'\n        console.log(value); // 1234.5\n      }}\n    /\u003e\n  );\n}\n\n// You can use predefinedOptions\nimport { predefinedOptions } from 'react-numeric';\n\nexport function PossitiveUSDMoneyInput(props){\n  const { value } = props; // number typed\n  return (\n    \u003cReactNumeric\n      value={value}\n      preDefined={predefinedOptions.dollarPos}\n      onChange={(e, value)=\u003e this.setState({ value })}\n    /\u003e\n  );\n}\n\n// if you want to store value as string typed\nexport function NumberInput(props){\n  const { value } = props; // string typed\n  return (\n    \u003cReactNumeric\n      value={value}\n      outputFormat=\"string\"\n      onChange={(e, value)=\u003e this.setState({ value })}\n    /\u003e\n  );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkg0%2Freact-numeric","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkg0%2Freact-numeric","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkg0%2Freact-numeric/lists"}