0.1.7 • Published 7 years ago

mcduck v0.1.7

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

mcduck

Convert integers and string formatted integers to a properly formatted currency and back again to an integer/string formatted integer

Build Status

Coverage Status

Installation

npm install mcduck --save or yarn add mcduck --save

Usage

RequireJS:

const mcduck = require('mcduck');

const formattedCurrency = mcduck.toCurrency('356660', 'USD');
Output should be 'USD 3 566.60';
const formattedCurrencyToInteger = mcduck.toInteger(formattedCurrency);
Output should be 356660;
const formattedCurrencyToIntegerString = mcduck.toIntegerString(formattedCurrency);
Output should be '356660';

es6:
import mcduck from 'mcduck';

const formattedCurrency = mcduck.toCurrency('356660', 'USD');
Output should be 'USD 3 566.60';
const formattedCurrencyToInteger = mcduck.toInteger(formattedCurrency);
Output should be 356660;
const formattedCurrencyToIntegerString = mcduck.toIntegerString(formattedCurrency);
Output should be '356660';

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.

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.0

7 years ago