Skip to content

๐Ÿ’ต A React Component to make formatting money/currency and dates easier ๐Ÿ“…

License

Notifications You must be signed in to change notification settings

divyagnan/react-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

React Format codecov npm version

A React Component to make formatting money/currency easier

Installation

npm i react-format --save

Usage

// First import an available formatting component
import { Money } from 'react-format';

// Then use it
<Money locale="en-US" currency="USD">3400</Money>
// This renders $3,400.00

API

Available Formatting Components

Money
<Money
  /*
   * This is an optional string with the code for the locale.
   * This defaults to "en-US"
   */
  locale="en-US"
  /*
   * This is an optional string with the code for the currency.
   * This defaults to "USD"
   */
  currency="USD"
>
{/* The child should be the number you want formatted */}
</Money>
Date
<Date
  /*
   * This is an optional string with the code for the locale.
   * This defaults to "en-US"
   */
  locale="en-US"
  /*
   * This is an optional object with options that you can pass in.
   * This defaults to an empty object.
   */
  options={}
>
  {/* The child should be the date you want formatted */}
</Date>

About

๐Ÿ’ต A React Component to make formatting money/currency and dates easier ๐Ÿ“…

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published