Standard library / strconv
strconv.FormatUint()
Formats an unsigned uint64 in base 2–36 using lowercase digits; invalid bases panic. Expected stdout: '11111\n'.
Formal Syntax & Structure
go syntaxgo
func FormatUint(i uint64, base int) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| i | uint64 | Integer value to encode. |
| base | int | Output radix 2–36. |
Return Value
string
Encoded representation.
Working Example
Example Snippetgo
package main
import ( "fmt" "strconv")
func main() { fmt.Println(strconv.FormatUint(31, 2))}