You are here

function similar_handler_field_similarity::render in Similar Entries 7.2

Same name and namespace in other branches
  1. 6.2 views/similar_handler_field_similarity.inc \similar_handler_field_similarity::render()

Renders the score as a number or a percentage that cannot exceed 50.

Overrides views_handler_field::render

File

views/similar_handler_field_similarity.inc, line 77
Provides a field for displaying the similarity score of similar entries.

Class

similar_handler_field_similarity
Similarity score field handler.

Code

function render($values) {
  $output = round($values->score * $this->options['multiply_score'], $this->options['round_decimal']);
  if ($this->options['score_type'] == 0) {
    return $output;
  }
  else {
    if (!empty($this->options['percent_suffix'])) {
      $output .= '%';
    }
    return $output;
  }
}