fix: leading 0 before seconds

This commit is contained in:
danilo silva 2020-05-24 21:13:17 +00:00
parent db891109aa
commit 0904223664

View file

@ -3,7 +3,7 @@ defmodule PodcastFeedWeb.FeedView do
def format_length(length) do
min = length / 60 |> trunc()
sec = length - (min * 60)
sec = length - (min * 60) |> Integer.to_string |> String.pad_leading(2, "0")
"#{min}:#{sec}"
end
end