提交 92c25f42 编写于 作者: R Robert Speicher

Use `number_to_human_size` helper to show repository size

This will intelligently format large repository sizes in GBs (or,
shudder, TBs).
上级 950ab1e8
......@@ -200,7 +200,8 @@ module ProjectsHelper
end
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
# In order to prevent 500 error
# when application cannot allocate memory
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册