Function

uni_numval

Numeric property.

Since v1.0
const char *uni_numval(

Parameters 🔗

c in

The input character.

Return Value 🔗

The value of Numeric_Value character property in decimal notation or NULL if the character does not have a numeric value.

Discussion 🔗

Return the Numeric_Value character property for the code point c. If the input character does not have a numeric value, then NULL is returned.

The numeric value is returned as a null terminated C string in decimal notation. That means if the character has a numeric value of -1/2, which is the case for TIBETAN DIGIT HALF ZERO (U+0F33), it would be returned as the string “-0.5”. The caller can interpret the string and convert to an integer or floating-point storage format as needed.

Support for the numeric value character property must be enabled in the JSON configuration file otherwise the function will always return NULL.

{
    "characterProperties": [
        "Numeric_Value"
    ]
}