uint -> string
package main
import (
"strconv"
)
func main() {
var i uint = 1000000
s := strconv.FormatUint(uint64(i), 10)
}
string -> uint
package main
import (
"strconv"
)
func main() {
u64, err := strconv.ParseUint("100000000", 10, 64)
if err != nil {
fmt.Println(err)
}
n := uint(u64)
}
참조
https://mingrammer.com/gobyexample/number-parsing/
'https://stackoverflow.com/questions/57187889/how-to-convert-uint-type-into-string-type-in-golang
728x90
'Programing Language > Golang' 카테고리의 다른 글
[Golang] gomail 이메일 발송 (0) | 2023.01.07 |
---|
댓글