function physical_dimension_unit_abbreviation in Physical Fields 7
Returns the translated abbreviation of a dimension unit of measurement.
Parameters
$unit: The dimension unit of measurement whose translated abbreviation should be returned; by default this can be in, ft, mm, cm, or m.
Return value
The translated abbreviation of the specified unit of measurement or FALSE if not found.
2 calls to physical_dimension_unit_abbreviation()
- physical_dimensions_format in ./
physical.module - Returns the formatted dimensions string for the given dimensions value array.
- physical_field_widget_form in ./
physical.module - Implements hook_field_widget_form().
File
- ./
physical.module, line 1164 - Defines fields (e.g. weight and dimensions) to support describing the physical attributes of entities.
Code
function physical_dimension_unit_abbreviation($unit) {
$units = physical_dimension_units();
if (!empty($units[$unit]['abbreviation'])) {
return $units[$unit]['abbreviation'];
}
return FALSE;
}