0.1.1 • Published 8 years ago
@domoinc/summary-number v0.1.1
Summary Number
This module crates a service that can convert numbers to abbeviated summary numbers.
Usage
$ npm start
to run webpack-dev-server$ npm test
to run unit tests$ npm tdd
to continuously run tests$ npm run jshint
to lint code$ npm run build
to build (and minify)$ npm version (patch|minor|major)
to create git release
Library Example
// init with language config
var service = new SummaryNumber(/* optional language config */);
// usage
var summaryNumber = service.summaryNumber(1234); // 1.23K
Language Config Example
var defaultConfig = {
decimal: '.',
thousands: ',',
summary: ['', 'K', 'M', 'B', 'T', 'Q'],
grouping: 3
};