# Haste Mass Units Various classes to handle weighable objects and convert between different mass units. You can either use the Weight object or implement one of the available interfaces. ## Supported mass units ## The `Unit` class can measure and convert between several mass units.
UnitShort nameConstant
MiligrammgUnit::MILIGRAM
GramgUnit::GRAM
KilogramkgUnit::KILOGRAM
Metric tontUnit::METRICTON
CaratcUnit::CARAT
OunceozUnit::OUNCE
PundlbUnit::POUND
StonestUnit::STONE
GraingrainUnit::GRAIN
## Examples ## ### Convert a weight ### ```php Returns `2.20459` ### Measure weight of multiple object ### ```php add(new \Haste\Units\Mass\Weight(1, \Haste\Units\Mass\Unit::KILOGRAM)); // Add 500 gram $objScale->add(new \Haste\Units\Mass\Weight(5000, \Haste\Units\Mass\Unit::MILIGRAM)); echo $objScale->amountIn(\Haste\Units\Mass\Unit::GRAM); ``` > Returns `1005` Add some more to the scale: ```php add(new \Haste\Units\Mass\Weight(3, \Haste\Units\Mass\Unit::STONE)); echo $objScale->amountIn(\Haste\Units\Mass\Unit::POUND); ``` > Returns `2257.60776`