Converts a given value to a number, returning 0 if the value cannot be parsed
as a valid finite number.
The function first attempts to coerce the value into a number using parseAsNumber.
If the resulting number is NaN or Infinity, the function returns 0. Otherwise,
it returns the parsed number.
Converts a given value to a number, returning
0
if the value cannot be parsed as a valid finite number.The function first attempts to coerce the value into a number using
parseAsNumber
. If the resulting number isNaN
orInfinity
, the function returns0
. Otherwise, it returns the parsed number.