Logo

Programming-Idioms

History of Idiom 55 > diff from v19 to v20

Edit summary for version 20 by :

Version 19

2015-10-02, 13:59:24

Version 20

2015-10-02, 13:59:49

Idiom #55 Convert integer to string

Create the string representation s (in radix 10) of integer value i.

Idiom #55 Convert integer to string

Create the string representation s (in radix 10) of integer value i.

Imports
import "strconv"
Imports
import "strconv"
Code
s := strconv.Itoa(i)
s10 := strconv.FormatInt(v, 10)
Code
s := strconv.FormatInt(i, 10)
Comments bubble
When i has type int64.
Comments bubble
When i has type int64.
Doc URL
https://golang.org/pkg/strconv/#FormatInt
Doc URL
https://golang.org/pkg/strconv/#FormatInt
Demo URL
http://play.golang.org/p/TE06SqU2Sc
Demo URL
http://play.golang.org/p/TE06SqU2Sc