fivestar module get count I am interested in getting the average count for a node.
Currently I am able to show the nodes rating with:

$fivestar = field_view_field('node', $node, 'field_cg_rating', 'basic');
render($fivestar);


But I just want to get the count instead of the entire html showing the vote. Just a numerical value.

Is there an easy way of doing this?
You can calc it with formula which is used by Fivestar on theme layer: http://drupalcode.org/project/fivestar.git/blob/refs/heads/7.x-2.x:/includes/fivestar.theme.inc#l132

$fivestar = field_view_field('node', $node, 'field_cg_rating');
$stars = 5; // Stars count from your field instance settings. Settings can be loaded with field_info_instance() if needed.
$rating = round(($fivestar['#items'][0]['average']/100) * $stars, 1);