std.itoa
Available inall subroutines.
Converts the integer value
to a string in the given base
.
The base
value defaults to 10 (decimal) and can range from 2 to 36 (inclusive).
Base prefixes, such as hexadecimal (0x
) and octal (0
), are not
included.
The character set used is 0123456789abcdefghijklmnopqrstuvwxyz
(0-9a-z
).
Errors
If the base
argument is less than 2 or greater than 36, then
fastly.error
will be set to EINVAL
.
Example
# decimal: "-10"std.itoa(-10)
# hexadecimal: "2a"std.itoa(42, 16)