Function

judo_numberify

Lexeme to float.

Since v1.0
enum judo_result judo_numberify(
const char *lexeme, int32_t length, judo_number *number)

Parameters πŸ”—

lexeme in

Lexeme of a JSON number.

length in

Number of UTF-8 code units in lexeme.

number out

Floating point representation of the lexeme.

Return Value πŸ”—

JUDO_SUCCESS

If the numeric value was written to number.

JUDO_INVALID_OPERATION

If stream, string, or number are NULL.

JUDO_OUT_OF_RANGE

If the number cannot be represented by judo_number.

JUDO_MALFUNCTION

If there is a defect in the implementation.

Discussion πŸ”—

The judo_numberify function converts a lexeme of a JSON number into its floating-point representation. The argument lexeme must point to a valid lexeme and length must be the lexeme’s length in UTF-8 code units. The implementation writes the floating-point value to number.