@domoinc/summary-number

A basic starter template for building reusable modules

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@domoinc/summary-number
Minified + gzip package size for @domoinc/summary-number in KB

Readme

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
};

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.