1.1.1 • Published 3 years ago

parse-formatted-number v1.1.1

Weekly downloads
25
License
MIT
Repository
github
Last release
3 years ago

parse-formatted-number

Parses a formatted number from a string and returns a number.

Usage

parseFormattedNumber(value[, options])

Parameters

  • value The value you want to parse.
  • options optional object of the following options:
    • decimal string decimal separator character, defaults to ".".

Return value

Number number parsed from the given value. If the value cannot be converted to a number, NaN is returned.

Example

import parseFormattedNumber from 'parse-formatted-number';

parseFormattedNumber('NZD $12,345.60');
// returns 12345.6

parseFormattedNumber('123,45', { decimal: ',' });
// returns 123.45
1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago