Convert Byte, KByte, MByte, GByte, TByte, PByte, EByte, ZByte and YByte into each other easy as to_b.
Add this line to your application's Gemfile:
gem 'humanize-bytes'
And then execute:
$ bundle
Or install it yourself as:
$ gem install humanize-bytes
Initialize a New Byte Object with
Humanize::Byte.new(1024)| Value | Equivalent | Call Methods |
|---|---|---|
| Byte | 1 Byte | to_b |
| Kilobyte | 1024 Bytes | to_k |
| Megabyte | 1024 Kilobytes | to_m |
| Gigabyte | 1024 Megabytes | to_g |
| Terabyte | 1024 Gigabytes | to_t |
| Petabyte | 1024 Terabytes | to_p |
| Exabyte | 1024 Petabytes | to_e |
| Zettabyte | 1024 Exabytes | to_z |
| Yottabyte | 1024 Zettabytes | to_y |
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
