erlang 格式化数字

with a length of 4 digits, the output of the integer 5 is "0005"


string:right(integer_to_list(5), 4, $0).


io:format("~4..0B~n", [5]).


 

posted @ 2014-03-01 23:01  xiao913  阅读(154)  评论(0编辑  收藏  举报