gabrielelana / byte-units

Library to parse, format and convert byte units
MIT License
162 stars 16 forks source link

Unit conversions #9

Open mikehayesuk opened 8 years ago

mikehayesuk commented 8 years ago

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

gabrielelana commented 8 years ago

Sure, PRs are more than welcome and the proposed API is nice and useful so please give it a try.

Please in you PR:

I'll try to give you feedback as quickly as possibile 😄

phansys commented 6 years ago

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

ignacio-dev commented 2 years ago

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

olaulau commented 3 weeks ago

+1, would be great to have unit conversion separated from the formatting !