Module: VirtualBox::ByteNormalizer

Included in:
HardDrive
Defined in:
lib/virtualbox/ext/byte_normalizer.rb

Constant Summary

THOUSAND =
1024.0
BYTE =
1.0
KILOBYTE =
BYTE * THOUSAND
MEGABYTE =
KILOBYTE * THOUSAND

Instance Method Summary (collapse)

Instance Method Details

- (Object) bytes_to_megabytes(b)



10
11
12
# File 'lib/virtualbox/ext/byte_normalizer.rb', line 10

def bytes_to_megabytes(b)
  b / MEGABYTE
end

- (Object) megabytes_to_bytes(mb)



14
15
16
# File 'lib/virtualbox/ext/byte_normalizer.rb', line 14

def megabytes_to_bytes(mb)
  mb * MEGABYTE
end