GB.NumberFromString

int GB.NumberFromString ( int option , const char *str , long len , GB_VALUE *value );

Reads a number inside a string and returns it in a GB_VALUE structure.

This function returns a non-zero value if nothing could be read inside the specified string.

  • If the string contains an Integer, the type field of the GB_VALUE structure is set to GB_T_INTEGER, and you can cast this structure to a GB_INTEGER to get the value.

  • If the string contains a Long, the type field of the GB_VALUE structure is set to GB_T_LONG, and you can cast this structure to a GB_LONG to get the value.

  • If the string contains a floating point number, the type field of the GB_VALUE structure is set to GB_T_FLOAT, and you can cast this structure to a GB_FLOAT to get the value.

See also