function theme_fivestar_formatter_percentage in Fivestar 7.2
Same name and namespace in other branches
- 6.2 includes/fivestar.field.inc \theme_fivestar_formatter_percentage()
- 6 fivestar_field.inc \theme_fivestar_formatter_percentage()
Theme function for 'percentage' fivestar field formatter.
File
- includes/
fivestar.theme.inc, line 151 - Provides the theming functions for fivestar.
Code
function theme_fivestar_formatter_percentage($variables) {
$element = $variables['element'];
if (empty($element['#item']['average'])) {
$element['#item']['average'] = 0;
}
return round($element['#item']['average'], 1) . '%';
}