Golang : Convert(cast) bigint to string
Problem :
You want to convert(cast) a big integer value to string for display.
Solution :
Use big.Int.String() function to convert the big integer value to string. For example :
package main
import (
"fmt"
"math/big"
)
func main() {
bigInt := big.NewInt(123456789)
bigStr := bigInt.String()
fmt.Println(bigStr)
}
Reference :
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
+21.3k Golang : For loop continue,break and range
+9.6k Golang : Play .WAV file from command line
+9.4k Golang : How to check if a string with spaces in between is numeric?
+8.2k Golang : HTTP Server Example
+8.3k Golang : Reverse text lines or flip line order example
+6.2k Golang : Convert Chinese UTF8 characters to Pin Yin
+8.1k Swift : Convert (cast) String to Float
+5.6k Gogland : Datasource explorer
+13k Swift : Convert (cast) Int or int32 value to CGFloat
+32.3k Golang : Convert an image file to []byte
+9.1k Android Studio : Image button and button example
+9.8k Golang : Copy map(hash table) example