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]).


原文地址:https://www.cnblogs.com/xiao0913/p/3618024.html