Convert a bigint to a string in Go

后端 未结 3 1107
不知归路
不知归路 2021-02-13 18:25

How do one convert a big int to a string (or integer) in Golang?

bigint := big.NewInt(123) //This is what I have
bigstr = \"123\" //This is what I want
         


        
3条回答
  •  庸人自扰
    2021-02-13 19:13

    I used the following:

    bigint := big.NewInt(1231231231231)
    bigstr := fmt.Sprint(bigint)
    

提交回复
热议问题