denomination

1.0.4 • Public • Published

Denomination Currency

A small library that fragmentations amount of money

Installation

$ npm install denomination --save

Usage

var denomination = require('denomination');
var fragments = [1e5, 5e4, 2e4, 1e4, 5e3, 2e3, 1e3, 500, 100, 50];

var formatted = denomination(fragments, 356660);

Output should be as array object

[ { notes: 100000, counter: 3 },
{ notes: 50000, counter: 1 },
{ notes: 5000, counter: 1 },
{ notes: 1000, counter: 1 },
{ notes: 500, counter: 1 },
{ notes: 100, counter: 1 },
{ notes: 50, counter: 1 } ]

Tests

$ npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i denomination

    Weekly Downloads

    5

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    3.62 kB

    Total Files

    5

    Last publish

    Collaborators

    • iwandede