simple-parse-number

0.1.1 • Public • Published

A simple clean way to parse numbers with Javascript

Setup

npm install simple-parse-number

Usage

var parseNumber = require('simple-format-number');
 
parseNumber('1,000.342'); // => 1000.342
parseNumber('1.000,342', { decimal: ',', grouping: '.' }); // => 1000.342 (italian format)

API

parseNumber(string, options)

where:

  • number the number to format
  • options (compatible with the symbols option of simple-format-number)
    • decimal the decimal symbol (default .)
    • grouping the grouping symbol (default ,)

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i simple-parse-number

    Weekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • gcanti