Skip to content

Repository files navigation

Humanize::Bytes Build Status

Convert Byte, KByte, MByte, GByte, TByte, PByte, EByte, ZByte and YByte into each other easy as to_b.

Installation

Add this line to your application's Gemfile:

gem 'humanize-bytes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install humanize-bytes

Usage

Initialize a New Byte Object with

Humanize::Byte.new(1024)

Conversion Table

ValueEquivalentCall Methods
Byte1 Byteto_b
Kilobyte1024 Bytesto_k
Megabyte1024 Kilobytesto_m
Gigabyte1024 Megabytesto_g
Terabyte1024 Gigabytesto_t
Petabyte1024 Terabytesto_p
Exabyte1024 Petabytesto_e
Zettabyte1024 Exabytesto_z
Yottabyte1024 Zettabytesto_y

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Convert Byte, Kbyte, MByte, Gbyte into each other

Resources

Stars

9 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages