Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a PHP library/class for manipulating units & quantities?

I am looking for a PHP library/class to manipulate units and quantities in a similar way to what the ruby-units gems does. I have found a port of that Ruby library to JavaScript called js-quantities, but not to PHP.

Are there any PHP libraries/classses for manipulating units & quantities out there?

like image 391
Max Avatar asked Nov 29 '12 12:11

Max


2 Answers

Zend Framework 1 did inlcude a component called Zend_Measure which is quite sophisticated but was dropped from Zend Framework 2.

like image 141
Stefan Gehrig Avatar answered Sep 23 '22 18:09

Stefan Gehrig


I've been searching for the same thing and came across https://github.com/triplepoint/php-units-of-measure

I haven't tried it myself yet, but it looks to be very complete.

Edit: I looked a bit at the class referenced above for what I was wanting and it didn't go into the US equivalent measures like teaspoons and tablespoons. The class can be enhanced, but I think I'll continue along my own path as I have been.

like image 21
KenB Avatar answered Sep 23 '22 18:09

KenB