This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
number_parsing [2017/03/21 16:05] – created korshun | number_parsing [2017/03/21 16:19] – korshun | ||
---|---|---|---|
Line 2: | Line 2: | ||
ACSUtils provides functions to convert strings to numbers. | ACSUtils provides functions to convert strings to numbers. | ||
- | Simple functions | + | ===== Simple functions |
+ | |||
+ | These simply return 0 on error, b: | ||
* [[functions: | * [[functions: | ||
* [[functions: | * [[functions: | ||
- | Complex functions: | + | ==== Examples ==== |
+ | |||
+ | < | ||
+ | atoi(" | ||
+ | atof(" | ||
+ | atoi(" | ||
+ | </ | ||
+ | |||
+ | ===== Complex functions | ||
+ | These return error status and result, and allow specifying an arbitrary base: | ||
* [[functions: | * [[functions: | ||
* [[functions: | * [[functions: | ||
+ | Error statuses are: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ==== Examples ==== | ||
+ | < | ||
+ | ParseInt(" | ||
+ | r1 -> PARSENUMBER_SUCCESS | ||
+ | r2 -> 123 | ||
+ | |||
+ | ParseInt(" | ||
+ | r1 -> PARSENUMBER_SUCCESS | ||
+ | r2 -> 8 | ||
+ | ParseInt(" |