coin-change-calculator

1.0.0 • Public • Published

coin-change-calculator

For a given value calculate the change in coins, e.g. 23 -> [20, 2, 1].

Install

$ npm install coin-change-calculator

Examples

const change = ccc(23);
// [20, 2, 1]
 
const change = ccc(23, [5, 1]);
// [5, 5, 5, 5, 1, 1, 1]

API

ccc(value, [denominations])

Denominations should be expressed as integers and if not supplied default to [100, 50, 20, 10, 5, 2, 1].

Running Tests

$ npm test

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i coin-change-calculator

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • zacbarton