You are here

function advpoll_round in Advanced Poll 7.3

Round value with advpoll_percentage_rounding_method

Parameters

float $percentage:

int $precision:

Return value

float

2 calls to advpoll_round()
advpoll_calculate_percentage in includes/advpoll_voteapi.inc
Return keyed array with percentages for each index.
advpoll_display_runoff_results in advpoll_ranking/advpoll_ranking.module
Determines how to theme poll results for Instant Run-off.

File

./advpoll.module, line 1202

Code

function advpoll_round($percentage, $precision = 0) {
  $rounding_method = variable_get('advpoll_percentage_rounding_method', 'round');
  if (is_callable($rounding_method)) {
    $result = $rounding_method($percentage, $precision);
  }
  else {
    $result = $percentage;
  }
  return $result;
}