Skip to content

johannes-scharlach/dehumanize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Turn humanized numbers back into machine numbers

Resources

License

Stars

Watchers

Forks

Packages

No packages published