数据的调整
This commit is contained in:
parent
45321dd6fe
commit
1727deb52e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue