Go 数字转字符串

Go About 198 words

int 类型

使用strconv.Itoa转换。

var age = 18
fmt.Println(strconv.Itoa(age))

int64 类型

使用strconv.FormatInt转换,指定base参数为10

unixTimestamp := time.Now().Unix()
fmt.Println(strconv.FormatInt(unixTimestamp, 10))
Views: 3,100 · Posted: 2021-07-20

———         Thanks for Reading         ———

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Next Post
Today In History
Browsing Refresh