Skip to main content

parseNumber()

parseNumber(val, __namedParameters): any

Converts a string to a number. Uses native parseFloat if parseNumbers is "native", otherwise uses numeric-quantity. If that returns NaN, the string is returned unchanged. Numeric values are returned as-is regardless of the parseNumbers option.

Parameters

ParameterType
valany
__namedParametersParseNumberOptions

Returns

any

Defined in

packages/react-querybuilder/src/utils/parseNumber.ts:18


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.