How to manage measurement units in a PHP web application?

Dolalleta

New Member
I am working on a LAMP web application which is managing a lot of data with different measurement units. This php application use a custom MVC framework. We now have customers in different countries and we would like to offer the choice to the customer between metric, imperial or combination.Currently, all the data are saved in international unit in our MySQL database. Some tables have multiple columns containing data with different units. What would be the best DB architecture to manage the display of all the data in the unit chosen by the customer (the user)?Is there any php classes, php function or web service which could help us?Thanks!UPDATE : If I decide to use a UnitConverter like the Zend Framework class, what would be the best way to define the unit for each data that I have in my Database?
  • A new table "measurement_unit" containing for each data type that I have in my DB the measurement type?
  • Should I add a new "measurement_type" column next to each data column that I have in my DB?
 
Back
Top