byte-units
byte-units copied to clipboard
Unit conversions
Hi
Thanks for a nice library. I'd like to be able to do something like this:
Binary::megabytes(15360)->as('GB'); // result = (int)15
If I gave this a go at some point would you accept a PR? Any advice on how you would prefer it to work?
Thanks, Mike
Sure, PRs are more than welcome and the proposed API is nice and useful so please give it a try.
Please in you PR:
- keep the formatting style
- unit test the whole thing
- don't brake previous tests
I'll try to give you feedback as quickly as possibile 😄
@mhayes14, do you plan to create a PR for this proposed feature?
Was this ever implemented? On the package description it states that it converts, but it only formats, compares and manipulates.