0.0.3 • Published 2 years ago

react-number-format-with-commas v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Number Formatted with Commas

It's just an input form with commas that returns the number (as a string sans commas) to the supplied onChange handler.

Installation

yarn add react-number-format-with-commas

or

npm install react-number-format-with-commas

Usage

import { InputNumberCommas } from 'react-number-format-with-commas';

const onChange: React.ChangeEventHandler<HTMLInputElement> = useCallback(
  (e) => setValue(e.target.value), // e.target.value is a string sans commas here
  [setValue]
);

<InputNumberCommas onChange={onChange} />;