The string value to be converted into a number.
A flag indicating whether to return the input string if it is not a valid number. Default value is false
.
returnStrings
is true
, the function returns the input string. If the input string is not a valid number and returnStrings
is false
, the function logs a warning message and returns ``.console.log(toNumber("-23.32")); // Output: -23.32
console.log(toNumber("abc")); // Output: "abc NaN"
Generated using TypeDoc
Converts a given string formatted value into a number.