少于1分钟
将以下英文翻译为中文:
https://gohugo.io/functions/int/
Casts a value to a decimal (base 10) integer.
int INPUT
With a decimal (base 10) input:
|
|
With a binary (base 2) input:
|
|
With an octal (base 8) input (use either notation):
|
|
With a hexadecimal (base 16) input:
|
|
Values with a leading zero are octal (base 8). When casting a string representation of a decimal (base 10) number, remove leading zeros:
{{ strings.TrimLeft "0" "0011" | int }} → 11