How to convert an integer to a string in Erlang

erlangstring

I know strings in Erlang can be costly to use. So how do I convert "5"to 5?

Is there anything like io:format("~p",[5]) that would return a formatted string instead of printing to a stream?

Best Answer

There's also integer_to_list/1, which does exactly what you want, without the ugliness.