In my experience, the best way to do this is:
Loop over each result, EXCEPT the last value. You can round each result in this loop, as normal. In the loop, also keep a variable which holds the cumulative value of each rounded result, e.g. $cumulative = $cumulative + $rounded_percentage.
For the last result, rather than rounding the value, just use (100 - $cumulative). This way, you'll always get 100 as the total.
The only problem with this method is that it is often slightly misleading - if you had 3 results, each with one vote, then your percentages would be 34%, 34% and 32%, which is obviously a bit misleading...