Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@domoinc/summary-number

jmstewart26MIT0.1.1

A basic starter template for building reusable modules

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