Erlang Cookbook
Being pretty new to Erlang I'm not familiar with the functionality contained within the standard library. Searching for ways to convert numbers to strings I came across the Erlang Cookbook which looks to be a very useful resource. For the record, converting a number to a string can be done using the 'format' function in the 'io_lib' module:
io_lib:format returns a list so I get the head of the list using 'hd'.
Categories: erlang
hd(io_lib:format("~B", [1000])).
=> "1000"
io_lib:format returns a list so I get the head of the list using 'hd'.
Categories: erlang

0 Comments:
Post a Comment
<< Home