This gem is no longer maintained.
filesize.rb provides a class for easily working with file sizes. That means:
Filesize.from("1 GiB")
# => #<Filesize:0x93c06c8 @bytes=1073741824, @type={:regexp=>/^([\d,.]+)?\s?(?:([kmgtpezy])i)?b$/i, :multiplier=>1024, :presuffix=>"i"}>
Filesize.from("1 GiB").to_f('KiB') # => 1048576.0
Filesize.from("1 GiB").to_f('KB') # => 1073741.824
Filesize.from("1 GB").to_i # => 1000000000
Filesize.from("12502343 B").to_s('GiB') # => "0.01 GiB"
Filesize.from("12502343 B").pretty # => "11.92 MiB"
Filesize.from("1 KB") <=> Filesize.from("1 MB") # => -1
(Filesize.from("1400 MB") + Filesize.from("1400 MiB")).pretty # => "2.87 GB"
(Filesize.from("1400 MiB") + Filesize.from("1400 MB")).pretty # => "2.67 GiB"
(Filesize.from("1400 MiB") + 1024).pretty # => "1.37 GiB"
(1024 + Filesize.from("1400 MB")).pretty # => "1.40 GB"
Filesize.from("1400 MiB") / Filesize.from("700 MiB") # => 2.0
Filesize::DVD / Filesize::CD # => 6.13566756571429