JSPM

react-currency

2.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 77
    • Score
      100M100P100Q67645F
    • License ISC

    Format a whole number as currency

    Package Exports

    • react-currency

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-currency) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    React Currency

    A react component for rendering whole numbers as currency

    run tests

    npm test

    running development setup locally

    npm run dev

    then visit localhost:8080

    building bundle file for webpack

    npm run build

    Consume in project

    Install via npm

    npm install react-currency --save

    Server render

    const React = require('react');
    const ReactDOMServer = require('react-dom/server');
    const currency = require('react-currency');
    
    const html = ReactDOMServer.renderToString(currency({symbol: "$", value: "100"}));

    Client render

    const React = require('react');
    const ReactDom = require('react-dom');
    const Currency = require('react-currency');
    
    ReactDom.render(<Currency symbol="$" value="100" /> document.getElementById('currency'));