dehumanize

1.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i dehumanize

    Weekly Downloads

    4

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • johanness