This is an old revision of the document!
ACSUtils provides functions to convert strings to numbers.
atoi("123") -> 123 atof("123.456") -> 123.456 atoi("abc") -> 0
These return error status and result, and allow specifying an arbitrary base:
Error statuses are:
PARSENUMBER_SUCCESS
– number successfully parsed, you can use the resultPARSENUMBER_BADFORMAT
- the number could not be parsed at all. You may not use the result. r2
is unchanged.<code> ParseInt(“123”, 0); r1 → PARSENUMBER_SUCCESS r2 → 123
ParseInt(“10”, 8); In base 8 r1 → PARSENUMBER_SUCCESS r2 → 8 ParseInt(“999999999