Logo

Programming-Idioms

History of Idiom 55 > diff from v79 to v80

Edit summary for version 80 by efrenfuentes:
[Elixir] We can use the string formatting too

Version 79

2019-10-14, 12:25:40

Version 80

2019-11-21, 21:15:04

Idiom #55 Convert integer to string

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

Illustration

Idiom #55 Convert integer to string

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

Illustration
Extra Keywords
int base radix conversion
Extra Keywords
int base radix conversion
Code
s = Integer.to_string(i)
s = to_string(i)
Code
s = Integer.to_string(i)
s = to_string(i)
s = "#{i}"
Comments bubble
Integer.to_string has checks if i is an Integer, to_string does not, whatever suits the usecase best.
Comments bubble
Integer.to_string has checks if i is an Integer, to_string does not, whatever suits the usecase best.
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Integer.html#to_string/1
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Integer.html#to_string/1