数据的调整

This commit is contained in:
cxt 2018-05-11 10:05:18 +08:00
parent 45321dd6fe
commit 1727deb52e
1 changed files with 2 additions and 2 deletions

View File

@ -4,9 +4,9 @@ module StatisticsHelper
def data_format_string num
result = num
if num < 1
result = format("%0.1f", (num*1024)).to_s + " GB"
result = format("%0.1f", (num*1024)).to_s + " KB"
elsif num < 1024
result = format("%0.1f", num).to_s + " GB"
result = format("%0.1f", num).to_s + " MB"
elsif num < 1024 * 1024
result = format("%0.1f", (num/1024)).to_s + " GB"
else