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 (

 func main() {
 bigInt := big.NewInt(123456789)
 bigStr := bigInt.String()


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.