Commit 92c25f42 authored by Robert Speicher's avatar Robert Speicher

Use `number_to_human_size` helper to show repository size

This will intelligently format large repository sizes in GBs (or,
shudder, TBs).
parent 950ab1e8
...@@ -200,7 +200,8 @@ module ProjectsHelper ...@@ -200,7 +200,8 @@ module ProjectsHelper
end end
def repository_size(project = @project) def repository_size(project = @project)
"#{project.repository_size} MB" size_in_bytes = project.repository_size * 1.megabyte
number_to_human_size(size_in_bytes, delimiter: ',', precision: 2)
rescue rescue
# In order to prevent 500 error # In order to prevent 500 error
# when application cannot allocate memory # when application cannot allocate memory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment