0.1.1 • Published 8 years ago

simple-parse-number v0.1.1

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

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 ,)