You are here

function physical_weight_unit_abbreviation in Physical Fields 7

Returns the translated abbreviation of a weight unit of measurement.

Parameters

$unit: The weight unit of measurement whose translated abbreviation should be returned; by default this can be lb, oz, kg, or g.

Return value

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

2 calls to physical_weight_unit_abbreviation()
physical_field_widget_form in ./physical.module
Implements hook_field_widget_form().
physical_weight_format in ./physical.module
Returns the formatted weight string for the given weight value array.

File

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

Code

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