Module: VirtualBox::ByteNormalizer

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

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#bytes_to_megabytes(b) ⇒ Object



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

def bytes_to_megabytes(b)
  b / MEGABYTE
end

#megabytes_to_bytes(mb) ⇒ Object



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

def megabytes_to_bytes(mb)
  mb * MEGABYTE
end