theme_fivestar_static will display a rating of 3.5 stars as 2 full stars and half of a third star, rather than 3 full stars and half of a fourth star.

This patch starts the for loop at 0 instead of 1, and does the equality comparison (for whole stars) against $next_star_value to compensate for this.

CommentFileSizeAuthor
fivestar.patch1.08 KBzroger

Comments

eaton’s picture

Status: Needs review » Fixed

Fixed, included in the new 1.2 release. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)
jonathan_hunt’s picture

FYI, after applying this patch, I had to alter

for ($n=0; $n <= $stars; $n++) {

to

for ($n=0; $n <= $stars -1; $n++) {

otherwise I was getting 11 stars displayed when $stars = 10;