How can I let users rate content with half stars in Fivestar? This is a quite regular feature request on the Drupal website (see for example this article), but there hasn't been provided a full answer anywhere and the answers only cover Drupal 6.

Instead of rating content with whole stars, I'd like my users to be able to vote with half stars (0.5, 1, 1.5, 2, etc.). On my website, voting on nodes happens via comments.

How can I achieve this? Which CSS and/or PHP changes do I eventually have to make to the Fivestar module?
I've written a module that alters the fivestar module to allow halfstar voting:

Halfstar

After installing the module an option is added to the field instance setting form allowing half star voting:



Which then allows voting with half stars:



There is a rounding bug that occurs occasionally at the moment when using the Stars (rated while editing) widget. If you have 9 stars and then vote 5.5 is display as 5.6.