Erlang: Output Problem

三世轮回 提交于 2019-12-06 14:34:29
Muzaaya Joshua

You should do this:

P = [1, 1, 2, 3, 5, 8, 13, 15],
Show_on_page = io_lib:format("~p",[P]),
Show_on_page.

This will represent any Erlang term on the web page the way you want to see it.

You Web presentation probably like the values more converted to string (lists).

1> [ integer_to_list(I) || I <- [1,1,2,3,5,8,13,15] ].
["1","1","2","3","5","8","13","15"]

Maybe join them as well depending on your formatting.

2> string:join([ integer_to_list(I) || I <- [1,1,2,3,5,8,13,15] ],",").
"1,1,2,3,5,8,13,15"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!