/deabbreviate-number-js

Deabbreviates a number string and remove unit letters e.g. '3.5m' => 3500000

Primary LanguageJavaScriptOtherNOASSERTION

deabbreviate-number

Deabbreviates a number string and remove unit letters e.g. '3.5m' => 3500000

build status

Code inspired by js-number-abbreviate

Example

var deabbreviate = require('deabbreviate-number')
deabbreviate('1k') // => 1000
deabbreviate('1.25K') // => 1250
deabbreviate('1 M') // => 1000000
deabbreviate('1b') // => 1000000000

Installation

npm install deabbreviate-number --save