money-formating

    0.1.2 • Public • Published

    MoneyFormating

    npm version License: MIT

    Convert and format money value (number, string, formatted and non-formatted).

    Installation

    npm or yarn:

    $ npm i money-formating
     

    Description

    A little package to format money values.

    Examples:

    Imports module:

    var formating = require('money-formating');

    Cents and Money formatter:

    //format money to cents value
    var cents = formating.moneyToCents(345623.01);
     
    console.log(cents); // 34562301
     
    //format cents to money value
    var money = formating.moneyToCents(cents);
     
    console.log(money); // 345623.01

    Cents/Money formatter to currency:

    var currency = formating.moneyToCents('345623.01');
     
    console.log(currency); // 345.623,01
     
    var currency2 = formating.moneyToCents('456733402', 'BRL');
     
    console.log(currency2); // R$ 4.567.334,02 <- brazilian real

    This is not a currency converter, just a formatter.

    Currency Data

    This lib uses the currency map from localeplanet API.

    License

    MIT

    Author

    Rogério Araújo

    Keywords

    none

    Install

    npm i money-formating

    DownloadsWeekly Downloads

    0

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    29.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • rodgeraraujo