uce/site/doc/pages/to_s64.txt
2026-06-15 21:42:50 +00:00

24 lines
499 B
Plaintext

:sig
s64 to_s64(String s, s64 fallback = 0)
:params
s : string to parse
fallback : value returned when `s` is empty or not a complete signed integer
return value : parsed s64, or `fallback`.
:see
>types
to_u64
to_f64
to_bool
int_val
:content
Parses a trimmed string as a base-10 signed integer.
The whole trimmed string must be consumed by the parser. Empty strings and partially parsed values such as `"-12px"` return the fallback.
```uce
s64 offset = to_s64(context.params["offset"], 0);
```