Datasizes
¶ ↑
datasizes gem provides simple API for converting dd
like data amount postfixes (like 3M
or 4G
) to bytes and bytes to these strings.
Usage is simple (see API reference for details):
Datasizes::to_bytes
(“3K”) # will return 3072 Datasizes::to_magnitude
(3072, :K) # will return “3K” Datasizes::from_bytes(3145728)
# will return “3M”
Contributing¶ ↑
-
Fork it.
-
Create a branch (
git checkout -b 20101220-my-change
). -
Commit your changes (
git commit -am "Added something"
). -
Push to the branch (
git push origin 20101220-my-change
). -
Create an Issue with a link to your branch.
-
Enjoy a refreshing Diet Coke and wait.
Copyright¶ ↑
Copyright © 2012-2014 Martin Poljak. See LICENSE.txt
for further details.