This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| functions:atoi [2017/03/21 13:59] – created korshun | functions:atoi [2017/04/17 12:33] (current) – korshun | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | Returns s converted | + | Returns s parsed as a decimal integer. If s cannot be parsed as an integer, returns 0. |
| + | |||
| + | If s is too big or too small to fit into int, returns [[constants: | ||
| + | |||
| + | Supports signs and [[:Number prefixes]]. | ||
| + | |||
| + | <note tip>To parse fixed-point numbers, use [[atof]].</ | ||
| + | |||
| + | <note tip>For more flexibility in parsing and error handling, use [[ParseInt]].</ | ||
| + | |||
| + | ===== Examples ===== | ||
| + | < | ||
| + | atoi(" | ||
| + | atoi("0") -> 0 | ||
| + | atoi(" | ||
| + | atoi(" | ||
| + | atoi(" | ||
| + | atoi(" | ||
| + | atoi(" | ||
| + | </ | ||
| - | See [[: | ||