function theme_fivestar_formatter_percentage in Fivestar 6.2
Same name and namespace in other branches
- 6 fivestar_field.inc \theme_fivestar_formatter_percentage()
- 7.2 includes/fivestar.theme.inc \theme_fivestar_formatter_percentage()
Theme function for 'percentage' fivestar field formatter.
File
- includes/
fivestar.field.inc, line 288 - Provides CCK integration for fivestar module
Code
function theme_fivestar_formatter_percentage($element) {
if (empty($element['#item']['rating']) || empty($element['#field']['stars'])) {
return 0;
}
return round(100 / $element['#item']['rating'], 1) / $element['#field']['stars'];
}