Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hsize() for human readable object sizes #43

Closed
HenrikBengtsson opened this issue Jan 12, 2016 · 0 comments
Closed

Add hsize() for human readable object sizes #43

HenrikBengtsson opened this issue Jan 12, 2016 · 0 comments

Comments

@HenrikBengtsson
Copy link
Owner

Example of hsize() usages:

hsize(1024)
1.0 KiB

hsize(1024^3)
1.0 GiB

hsize(1024^3, units="bytes")
1073741824 bytes

hsize(1024^3, units="SI")
1.1 GB

hsize(1024^3, digits=3, units="SI")
1.074 GB

hsize(8192, digits=2, units="SI")
8.92 kB

The default should be units=getOption("hsize", "IEC"). If R ever gets its own option for this and/or choose a different default, we can easily depend on that here too.

See also HenrikBengtsson/Wishlist-for-R#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant