add .formatter.exs + format

This commit is contained in:
Martino Visintin
2018-05-22 21:46:54 +01:00
parent 08c90ce0d8
commit b07df7c780
52 changed files with 332 additions and 264 deletions

View File

@@ -1,5 +1,4 @@
defmodule Display.ProgressBar do
@progress_bar_length 30
def progress_bar(%{current: current, total: total}) do
@@ -9,11 +8,12 @@ defmodule Display.ProgressBar do
end
defp calculate_progress(current, total) do
round( (current/total) * @progress_bar_length)
round(current / total * @progress_bar_length)
end
defp build_arrow(0), do: ""
defp build_arrow(length) do
String.duplicate("=", length-1) <> ">"
String.duplicate("=", length - 1) <> ">"
end
end