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: 1,529 · Posted: 2021-07-19

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

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

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


Today On History
Browsing Refresh