Neanderthal Pudding Mix

    jsx-number-format

    0.1.5 • Public • Published

    JSX Number Format

    This is a lightweight js number formatting library

    To install

    npm install jsx-number-format

    Usage

    • Syntax
    NumberFormat(float,decimal_places,thousand_seperater)
    • Permitted thousand separators are :
      • Comma(,)
      • Space(" ")
    const {NumberFormat} = require('jsx-number-format');
    let formattedNumber =NumberFormat(5000,2,',');
    // or formatNumber = NumberFormat(5000);
    /*5000 is the amount to format
    * 2 decimal places (optional)
    * , is the thousand delimiter(optional)
    * result: 5,000.00
    */
    let formattedNumber2 =  NumberFormat(5000.789,2,',');
    /*or formattedNumber2 =  NumberFormat(5000.789);
    * gives 5,000.79
    */
    //Having .004 which the last value 4 is less than 5
    let formattedNumber3 =  NumberFormat(5000.004,2,',');
    /* or let formattedNumber3 =  NumberFormat(5000.004);
    * gives 5,000.00
    */

    Install

    npm i jsx-number-format

    DownloadsWeekly Downloads

    17

    Version

    0.1.5

    License

    MIT

    Unpacked Size

    2.31 kB

    Total Files

    3

    Last publish

    Collaborators

    • keringdered