Number parsing

ACSUtils provides functions to convert strings to numbers.

Simple functions

These simply return 0 on error:

atoi

atof

atoi("123") -> 123
atof("123.456") -> 123.456
atoi("abc") -> 0

Complex functions

These return error status and result, and allow specifying an arbitrary base:

ParseInt

ParseFixed

Error statuses are:

PARSENUMBER_SUCCESS – number successfully parsed, you can use the result

PARSENUMBER_OVERFLOW – the number is too big to fit into a variable, the result will be either INT_MAX or INT_MIN.

PARSENUMBER_BADFORMAT - the number could not be parsed at all. You may not use the result. r2 is unchanged.