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
+5.2k Golang : Verify Linux user password again before executing a program example
+6.2k Golang : Recombine chunked files example
+3.4k Golang : Command line ticker to show work in progress
+4.8k Golang : Get login name from environment and prompt for password
+2.6k Golang : Totalize or add-up an array or slice example
+9.7k Golang : Populate dropdown with html/template example
+7.9k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+6.8k Swift : Convert (cast) Int or int32 value to CGFloat
+2.3k Android Studio : Hello World example
+16k Golang : Change a file last modified date and time
+7.5k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+13.1k Golang : Execute shell command