You are here

function dimension_calculate in Dimension 7

------------------------ Helper functions -----------------------------------

2 calls to dimension_calculate()
theme_dimension_theme_simple in ./dimension.module
Callback to theme a complete dimension field with all values combined into a single line with the labels shortened to the first character.
theme_dimension_theme_table in ./dimension.module
Callback to theme a complete dimension field with one value per line and a leading label for each of them.

File

./dimension.module, line 414

Code

function dimension_calculate($dimensions, $settings) {
  $length = (isset($dimensions['length']) ? $dimensions['length'] : 1) * $settings['length']['factor'];
  $height = (isset($dimensions['height']) ? $dimensions['height'] : 1) * $settings['height']['factor'];
  $width = (isset($dimensions['width']) ? $dimensions['width'] : 1) * $settings['width']['factor'];
  return $length * $width * $height;
}