parseNumber

Converts a string into a Number based on the specified locale.

For a runnable example, refer to the article on
date and number formatting and parsing.

Parameters

value string

The string that will be parsed.

locale? string

The locale id that defines the locale whose information should be used to parse the string.

format? string | NumberFormatOptions

The format that is used to parse the string. Useful when non-default currencies are parsed.

Returns

number - The parsed number.