1.0.1 • Published 6 years ago

dehumanize v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

dehumanize

Turn humanized numbers back into machine numbers

Works well for UI tests if numbers are humanized with humanize-plus

Installation

This package is available on npm, so you can install it with npm

$ npm install --save-dev dehumanize

or if you prefer yarn

$ yarn add --dev dehumanize

Usage

Currently only one method fromCompactInteger is exposed. The delimiter and thousands separator are not (yet) configurable.

Basic Usage

const { fromCompactInteger } = require("dehumanize")

fromCompactInteger("56") // 56 as a number
fromCompactInteger("34k") // 34000
fromCompactInteger("6.54M") // 6540000
fromCompactInteger("4,321") // 4321