You are here

public function UnitsMathematicalExpression::formatQuantity in Units of Measurement 7.2

Format a certain amount of quantity within this mathematical expression.

Parameters

float $quantity: Quantity to be formatted

Return value

UnitsMathematicalExpression Formatted quantity into this mathematical expression. Sometimes the mathematical expression itself must mutate in order to format the quantity. So the returned mathematical expression may not necessarily be the mathematical expression on which this method was invoked. For example, the expression "unit" would mutate into "1 * unit" in order to have a dimensionless member and therefore be able to format the $quantity

3 methods override UnitsMathematicalExpression::formatQuantity()
AbstractUnitsMathematicalOperator::formatQuantity in ./units.module
Format a certain amount of quantity within this mathematical expression.
UnitsConstantMathematicalExpression::formatQuantity in ./units.module
Format a certain amount of quantity within this mathematical expression.
UnitsEntity::formatQuantity in includes/UnitsEntity.class.inc
Format a certain amount of quantity within this mathematical expression.

File

./units.module, line 1171
Provide API for managing and converting units of measurement.

Class

UnitsMathematicalExpression
Interface of "mathematical expression".

Code

public function formatQuantity($quantity);