This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
functions:atof [2017/04/17 15:08] – korshun | functions:atof [2017/04/17 15:33] (current) – korshun | ||
---|---|---|---|
Line 8: | Line 8: | ||
If s is too big or too small to fit into a fixed-point number, returns [[constants: | If s is too big or too small to fit into a fixed-point number, returns [[constants: | ||
- | Supports [[:Number prefixes]]. | + | Supports |
<note important> | <note important> | ||
</ | </ | ||
+ | |||
+ | <note tip>To parse ints, use [[atoi]].</ | ||
+ | |||
+ | <note tip>For more flexibility in parsing and error handling, use [[ParseFixed]].</ | ||
===== Examples ===== | ===== Examples ===== | ||
< | < | ||
- | atoi(" | + | atof(" |
- | atoi(" | + | atof(" |
- | atoi(" | + | atof(" |
- | atoi(" | + | atof(" |
- | atoi("not a number" | + | atof(" |
- | atoi("1.3") -> 0 // Error | + | atof("not a number" |
- | atoi(" | + | atof("0xff.8") -> 255.5 // Hexadecimal prefix |
</ | </ | ||