项目作者: xDae

项目描述 :
💵 react component for currency formatting
高级语言: JavaScript
项目地址: git://github.com/xDae/react-currency-formatter.git
创建时间: 2017-03-26T20:57:57Z
项目社区:https://github.com/xDae/react-currency-formatter

开源协议:MIT License

下载


💵 react currency formatter

npm
npm
David
Travis
license

💻 DEMO!

Usage

Simple

  1. import Currency from 'react-currency-formatter';
  2. <Currency
  3. quantity={45685}
  4. currency="EUR"
  5. ></Currency>

Complex

  1. import Currency from 'react-currency-formatter';
  2. <Currency
  3. quantity={45685} // Required
  4. currency="USD" // Optional (USD by default)
  5. locale="en_EN" // Optional
  6. pattern="##,### !" // Optional
  7. decimal="," // Optional
  8. group="." // Optional
  9. ></Currency>

TypeScript

  1. import * as React from 'react'
  2. import * as CurrencyFormatter from 'react-currency-formatter'
  3. type Props = {
  4. price: number,
  5. currency: string,
  6. }
  7. const ProductionPrice: React.SFC<Props> = (props: Props) => (
  8. <CurrencyFormatter quantity={props.price} currency={props.currency} ></CurrencyFormatter>
  9. )
  10. export default ProductionPrice

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.