Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

gcanti/simple-parse-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple clean way to parse numbers with Javascript

Resources

License

Stars

Watchers

Forks

Packages

No packages published