You are here

function physical_volume_unit_abbreviation in Physical Fields 7

Returns the translated abbreviation of a volume unit of measurement.

Parameters

string $type: The type of volume unit whose name should be returned; by default this can be l, m3, ml, fl oz, pt, gal.

Return value

string|bool The translated abbreviation of the specified unit of measurement or FALSE if not found.

2 calls to physical_volume_unit_abbreviation()
physical_field_widget_form in ./physical.module
Implements hook_field_widget_form().
physical_volume_format in ./physical.module
Returns the formatted volume string for the given volume value array.

File

./physical.module, line 665
Defines fields (e.g. weight and dimensions) to support describing the physical attributes of entities.

Code

function physical_volume_unit_abbreviation($unit) {
  $units = physical_volume_units();
  if (!empty($units[$unit]['abbreviation'])) {
    return $units[$unit]['abbreviation'];
  }
  return FALSE;
}