Manipulating Measurements

Types of measurements

All supported measurement types are listed below, each with an example of the standard usage for such measurements.

List of measurement types
Typ Class Standardunit Description
Acceleration Zend_Measure_Acceleration Meter per square second | m/s² Zend_Measure_Acceleration covers the physical factor of acceleration.
Angle Zend_Measure_Angle Radiant | rad Zend_Measure_Angle covers angular dimensions.
Area Zend_Measure_Area Square meter | Zend_Measure_Area covers square measures.
Binary Zend_Measure_Binary Byte | b Zend_Measure_Binary covers binary conversions.
Capacitance Zend_Measure_Capacitance Farad | F Zend_Measure_Capacitance covers physical factor of capacitance.
Cooking volumes Zend_Measure_Cooking_Volume Cubic meter | Zend_Measure_Cooking_Volume covers volumes which are used for cooking or written in cookbooks.
Cooking weights Zend_Measure_Cooking_Weight Gram | g Zend_Measure_Cooking_Weight covers the weights which are used for cooking or written in cookbooks.
Current Zend_Measure_Current Ampere | A Zend_Measure_Current covers the physical factor of current.
Density Zend_Measure_Density Kilogram per cubic meter | kg/m³ Zend_Measure_Density covers the physical factor of density.
Energy Zend_Measure_Energy Joule | J Zend_Measure_Energy covers the physical factor of energy.
Force Zend_Measure_Force Newton | N Zend_Measure_Force covers the physical factor of force.
Flow (mass) Zend_Measure_Flow_Mass Kilogram per second | kg/s Zend_Measure_Flow_Mass covers the physical factor of flow rate. The weight of the flowing mass is used as reference point within this class.
Flow (mole) Zend_Measure_Flow_Mole Mole per second | mol/s Zend_Measure_Flow_Mole covers the physical factor of flow rate. The density of the flowing mass is used as reference point within this class.
Flow (volume) Zend_Measure_Flow_Volume Cubic meter per second | m³/s Zend_Measure_Flow_Volume covers the physical factor of flow rate. The volume of the flowing mass is used as reference point within this class.
Frequency Zend_Measure_Frequency Hertz | Hz Zend_Measure_Frequency covers the physical factor of frequency.
Illumination Zend_Measure_Illumination Lux | lx Zend_Measure_Illumination covers the physical factor of light density.
Length Zend_Measure_Length Meter | m Zend_Measure_Length covers the physical factor of length.
Lightness Zend_Measure_Lightness Candela per square meter | cd/m² Zend_Measure_Ligntness covers the physical factor of light energy.
Number Zend_Measure_Number Decimal | (10) Zend_Measure_Number converts between number formats.
Power Zend_Measure_Power Watt | W Zend_Measure_Power covers the physical factor of power.
Pressure Zend_Measure_Pressure Newton per square meter | N/m² Zend_Measure_Pressure covers the physical factor of pressure.
Speed Zend_Measure_Speed Meter per second | m/s Zend_Measure_Speed covers the physical factor of speed.
Temperature Zend_Measure_Temperature Kelvin | K Zend_Measure_Temperature covers the physical factor of temperature.
Time Zend_Measure_Time Second | s Zend_Measure_Time covers the physical factor of time.
Torque Zend_Measure_Torque Newton meter | Nm Zend_Measure_Torque covers the physical factor of torque.
Viscosity (dynamic) Zend_Measure_Viscosity_Dynamic Kilogram per meter second | kg/ms Zend_Measure_Viscosity_Dynamic covers the physical factor of viscosity. The weight of the fluid is used as reference point within this class.
Viscosity (kinematic) Zend_Measure_Viscosity_Kinematic Square meter per second | m²/s Zend_Measure_Viscosity_Kinematic covers the physical factor of viscosity. The distance of the flown fluid is used as reference point within this class.
Volume Zend_Measure_Volume Cubic meter | Zend_Measure_Volume covers the physical factor of volume (content).
Weight Zend_Measure_Weight Kilogram | kg Zend_Measure_Weight covers the physical factor of weight.

Hints for Zend_Measure_Binary

Some popular binary conventions, include terms like kilo-, mega-, giga, etc. in normal language use imply base 10, such as 1000 or 10³. However, in the binary format for computers these terms have to be seen for a conversion factor of 1024 instead of 1000. To preclude confusions a few years ago the notation BI was introduced. Instead of kilobyte, kibibyte for kilo-binary-byte should be used.

In the class BINARY both notations can be found, such as KILOBYTE = 1024 - binary conputer conversion KIBIBYTE = 1024 - new notation KILO_BINARY_BYTE = 1024 - new, or the notation, long format KILOBYTE_SI = 1000 - SI notation for kilo (1000). DVDs for example are marked with the SI-notation, but almost all harddisks are marked in computer binary notation.

Hints for Zend_Measure_Number

The best known number format is the decimal system. Additionally this class supports the octal system, the hexadecimal system, the binary system, the roman number system and some other less popular systems. Note that only the decimal part of numbers is handled. Any fractional part will be stripped.

Roman numbers

For the roman number system digits greater 4000 are supported. In reality these digits are shown with a crossbeam on top of the digit. As the crossbeam can not be shown within the computer, an underline has to be used instead of it.

  1. $great = '_X';
  2. $locale = new Zend_Locale('en');
  3. $unit = new Zend_Measure_Number($great,Zend_Measure_Number::ROMAN, $locale);
  4.  
  5. // convert to the decimal system
  6. echo $unit->convertTo(Zend_Measure_Number::DECIMAL);

Manipulating Measurements