You are here

function farm_area_relative_size in farmOS 7

Subjectively define the relative size of an area measurement.

Parameters

$measurement: The area measurement value in square meters.

Return value

string Returns the subjective size of the area ('big' or 'small').

3 calls to farm_area_relative_size()
farm_area_format_calculated_area in modules/farm/farm_area/farm_area.module
Format a calculated area in the default system of measurement.
farm_soil_amendment_form in modules/farm/farm_soil/farm_soil.farm_quick.amendment.inc
Soil amendment quick form.
farm_soil_disturbance_form in modules/farm/farm_soil/farm_soil.farm_quick.disturbance.inc
Soil disturbance quick form.

File

modules/farm/farm_area/farm_area.module, line 552

Code

function farm_area_relative_size($measurement) {

  // Start with an assumption that the area is big.
  $size = 'big';

  // Get the default units for the relative area size.
  $units = farm_area_default_units('area', 'big');

  // If the converted value is less than 0.25, then the relative size is small.
  if (farm_area_convert_area_units($measurement, $units) < 0.25) {
    $size = 'small';
  }

  // Return the relative size.
  return $size;
}