NumberFormat
number-format-react
is a React component implementation of the
Intl.NumberFormat
global object.
Install
-
npm install number-format-react
or yarn add number-format-react
Use
import NumberFormat from 'number-format-react';
function MyComponent() {
return (
<p>
My favorite number is
<NumberFormat>3141.58</NumberFormat>!
</p>
);
}
Props
The NumberFormat
component supports the entire Intl.NumberFormat
API via
its props, with strong type-checking. For a full catalog of the
Intl.NumberFormat
API, check out
MDN's documentation.