Golang : Convert uint value to string type
Problem :
You have an uint value and you want to convert(cast) the value into string.
Solution :
Use strconv.FormatUint()
function to convert the uint64 value to string.
For example :
package main
import (
"fmt"
"strconv"
)
func main() {
var uval uint64 = 1 * (1 << 20)
str := strconv.FormatUint(uval, 10)
fmt.Println(str) // uint64 in string format
}
See also : Golang : Convert(cast) int to int64
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+9.2k Golang : Changing a RGBA image number of channels with OpenCV
+11k Golang : Characters limiter example
+14.1k Golang : GUI with Qt and OpenCV to capture image from camera
+6.8k Golang : Transform lisp or spinal case to Pascal case example
+3.3k Golang : Switch Redis database redis.NewClient
+10.7k How to test Facebook App on localhost ?
+16.6k Golang : Get input from keyboard
+13.5k Golang : How to check if a file is hidden?
+13k Android Studio : Password input and reveal password example
+7.1k Golang : Check to see if *File is a file or directory
+18.9k Golang : Execute shell command
+6.3k Golang : How to validate ISBN?