How to use strconv.FormatUint() Function in Golang? Last Updated : 03 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Go language provides inbuilt support to implement conversions to and from string representations of basic data types by strconv Package. This package provides a FormatUint() function which is used to return the string representation of x in the given base, i.e., 2 <= base <= 36. Here, the result uses the lower-case letters 'a' to 'z' for digit values which is greater than equals to 10. To access FormatUint() function you need to import strconv Package in your program with the help of import keyword. Syntax: func FormatUint(x uint64, base int) string Parameter: This function takes two parameters, i.e., x and base. Return value: This function returns the string representation of x in the given base, i.e., 2 <= base <= 36. Example 1: C // Golang program to illustrate // strconv.FormatUint() Function package main import ( "fmt" "strconv" ) func main() { // Finding the string representation // of given value in the given base // Using FormatUint() function fmt.Println(strconv.FormatUint(11, 2)) fmt.Println(strconv.FormatUint(24, 10)) } Output: 1011 24 Example 2: C // Golang program to illustrate // strconv.FormatUint() Function package main import ( "fmt" "strconv" ) func main() { // Finding the string representation // of given value in the given base // Using FormatUint() function val1 := uint64(25) res1 := strconv.FormatUint(val1, 2) fmt.Printf("Result 1: %v", res1) fmt.Printf("\nType 1: %T", res1) val2 := uint64(20) res2 := strconv.FormatUint(val2, 16) fmt.Printf("\nResult 2: %v", res2) fmt.Printf("\nType 2: %T", res2) } Output: Result 1: 11001 Type 1: string Result 2: 14 Type 2: string Comment More infoAdvertise with us A ankita_saini Follow Improve Article Tags : Go Language Golang-strconv Similar Reads Go Tutorial Go or you say Golang is a procedural and statically typed programming language having the syntax similar to C programming language. It was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launched in 2009 as an open-source programming language and mainly used in Google 2 min read Go Programming Language (Introduction) Go is a procedural programming language. It was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launched in 2009 as an open-source programming language. Programs are assembled by using packages, for efficient management of dependencies. This language also supports env 11 min read time.Sleep() Function in Golang With Examples In Go language, time packages supplies functionality for determining as well as viewing time. The Sleep() function in Go language is used to stop the latest go-routine for at least the stated duration d. And a negative or zero duration of sleep will cause this method to return instantly. Moreover, t 3 min read Golang Tutorial - Learn Go Programming Language This Golang tutorial provides you with all the insights into Go Language programming, Here we provide the basics, from how to install Golang to advanced concepts of Go programming with stable examples. So, if you are a professional and a beginner, this free Golang tutorial is the best place for your 10 min read Top 10 Golang Project Ideas with Source Code in 2025 Golang, or Go, a programming language was created by Google. It's widely used for building different kinds of applications like websites and cloud services. The fastest way to master this language is by building projects related to it. This article introduces 10 beginner-friendly to medium-difficult 8 min read Interfaces in Golang In Go, an interface is a type that lists methods without providing their code. You canât create an instance of an interface directly, but you can make a variable of the interface type to store any value that has the needed methods.Exampletype Shape interface { Area() float64 Perimeter() float64}In t 3 min read strings.Contains Function in Golang with Examples strings.Contains Function in Golang is used to check the given letters present in the given string or not. If the letter is present in the given string, then it will return true, otherwise, return false. Syntax:Â func Contains(str, substr string) bool Here, str is the original string and substr is t 2 min read Data Types in Go Data types specify the type of data that a valid Go variable can hold. In Go language, the type is divided into four categories which are as follows: Basic type: Numbers, strings, and booleans come under this category.Aggregate type: Array and structs come under this category.Reference type: Pointer 7 min read fmt.Sprintf() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sprintf() function in Go language formats according to a format specifier and returns the resulting string. Moreover, this function is defined under the fmt package. Here, you 2 min read Goroutines - Concurrency in Golang Goroutines in Go let functions run concurrently, using less memory than traditional threads. Every Go program starts with a main Goroutine, and if it exits, all others stop.Examplepackage mainimport "fmt"func display(str string) { for i := 0; i < 3; i++ { fmt.Println(str) }}func main() { go displ 2 min read Like