Skip to content

Commit

Permalink
Refactored and fixed a bug when seconds (float or integer) < 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
runejuhl committed Aug 4, 2012
1 parent e927a3f commit 788a0f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/filter_lib/erlydtl_dateformat.erl
Expand Up @@ -359,12 +359,12 @@ monthname(12) -> "december";
monthname(_) -> "???".

% Utility functions
integer_to_list_zerofill(N) when not is_integer(N) ->
integer_to_list_zerofill(erlang:round(N));
integer_to_list_zerofill(N) when N < 10 ->
lists:flatten(io_lib:format("~2..0B", [N]));
integer_to_list_zerofill(N) when is_integer(N) ->
integer_to_list(N);
integer_to_list_zerofill(N) ->
integer_to_list_zerofill(erlang:round(N)).
integer_to_list(N).

ucfirst([First | Rest]) when First >= $a, First =< $z ->
[First-($a-$A) | Rest];
Expand Down

0 comments on commit 788a0f6

Please sign in to comment.