thin_metadata_size,create_xml_data: fix units

This commit is contained in:
Heinz Mauelshagen 2013-06-26 14:59:25 +02:00
parent 2fa1ce95eb
commit 11cec295ce
2 changed files with 4 additions and 4 deletions

View File

@ -15,14 +15,14 @@ $prg = Pathname.new($0).basename
def init_units def init_units
units = {} units = {}
units[:bytes_per_sector] = 512 units[:bytes_per_sector] = 512
units[:chars] = "bsKkMmGgTtPpEeZzYy" units[:chars] = "bskKmMgGtTpPeEzZyY"
units[:strings] = [ 'bytes', 'sectors', units[:strings] = [ 'bytes', 'sectors',
'kilobytes', 'kibibytes', 'megabytes', 'mebibytes', 'kilobytes', 'kibibytes', 'megabytes', 'mebibytes',
'gigabytes', 'gibibytes', 'terabytes', 'tebibytes', 'gigabytes', 'gibibytes', 'terabytes', 'tebibytes',
'petabytes', 'pebibytes', 'exabytes', 'ebibytes', 'petabytes', 'pebibytes', 'exabytes', 'ebibytes',
'zetabytes', 'zebibytes', 'yottabytes', 'yobibytes' ] 'zetabytes', 'zebibytes', 'yottabytes', 'yobibytes' ]
units[:factors] = [ 1, units[:bytes_per_sector] ] units[:factors] = [ 1, units[:bytes_per_sector] ]
1.step(8) { |e| units[:factors] += [ 1000**e, 1024**e ] } 1.step(8) { |e| units[:factors] += [ 1024**e, 1000**e ] }
units units
end end

View File

@ -20,14 +20,14 @@ $prg = Pathname.new($0).basename
def init_units def init_units
units = {} units = {}
units[:bytes_per_sector] = 512 units[:bytes_per_sector] = 512
units[:chars] = "bsKkMmGgTtPpEeZzYy" units[:chars] = "bskKmMgGtTpPeEzZyY"
units[:strings] = [ 'bytes', 'sectors', units[:strings] = [ 'bytes', 'sectors',
'kilobytes', 'kibibytes', 'megabytes', 'mebibytes', 'kilobytes', 'kibibytes', 'megabytes', 'mebibytes',
'gigabytes', 'gibibytes', 'terabytes', 'tebibytes', 'gigabytes', 'gibibytes', 'terabytes', 'tebibytes',
'petabytes', 'pebibytes', 'exabytes', 'ebibytes', 'petabytes', 'pebibytes', 'exabytes', 'ebibytes',
'zetabytes', 'zebibytes', 'yottabytes', 'yobibytes' ] 'zetabytes', 'zebibytes', 'yottabytes', 'yobibytes' ]
units[:factors] = [ 1, units[:bytes_per_sector] ] units[:factors] = [ 1, units[:bytes_per_sector] ]
1.step(8) { |e| units[:factors] += [ 1000**e, 1024**e ] } 1.step(8) { |e| units[:factors] += [ 1024**e, 1000**e ] }
units units
end end