function units_dimension_equal in Units of Measurement 7.2
Check whether the 2 dimensions are equal.
Parameters
array $dimension1: Dimension array #1
array $dimension2: Dimension array #2
Return value
bool Whether the 2 provided dimension arrays are equal
4 calls to units_dimension_equal()
- AbstractUnitsMathematicalOperator::evaluate in ./
units.module - Numerically evaluate this mathematical expression.
- units_mathematical_expression_element_validate in ./
units.module - Validate function for 'units_mathematical_expression' form element.
- units_mathematical_expression_format_as in ./
units.module - Format one mathematical expression to the format of another.
- units_units_unit_presave in ./
units.module - Implements hook_ENTITY_TYPE_presave().
File
- ./
units.module, line 470 - Provide API for managing and converting units of measurement.
Code
function units_dimension_equal($dimension1, $dimension2) {
$diff = units_dimension_subtract($dimension1, $dimension2);
return empty($diff);
}