You are here

function physical_weight_format in Physical Fields 7

Returns the formatted weight string for the given weight value array.

Parameters

$value: A weight field value array containing weight and unit keys.

1 call to physical_weight_format()
physical_field_formatter_view in ./physical.module
Implements hook_field_formatter_view().

File

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

Code

function physical_weight_format($value) {
  return t('@weight @unit', array(
    '@weight' => round($value['weight'], 5),
    '@unit' => physical_weight_unit_abbreviation($value['unit']),
  ));
}