byte-units icon indicating copy to clipboard operation
byte-units copied to clipboard

Unit conversions

Open mikehayesuk opened this issue 8 years ago • 4 comments

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

mikehayesuk avatar Jul 11 '16 00:07 mikehayesuk

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 😄

gabrielelana avatar Jul 11 '16 10:07 gabrielelana

@mhayes14, do you plan to create a PR for this proposed feature?

phansys avatar Feb 20 '18 22:02 phansys

Was this ever implemented? On the package description it states that it converts, but it only formats, compares and manipulates.

ignacio-dev avatar Aug 02 '22 16:08 ignacio-dev