title: Star rating with half star support
body: <p>I am running into a problem rendering a star rating and was hoping I can get some extra eyeballs on my problem. I have the normal rating working just fine with whole numbers but I am struggling to display the half star. For example I created a service that provides me with a rating 0-5 so I get a value like 2.5, 3 or 5 etc... </p>
  
  <p>Before I go and create a switch case and create an svg for each variation I was hoping to get a little a pointer. Below is what I have currently, any tips would be greatly appreciated.</p>
  
  <pre><code>&lt;?php
       for ($i = 1; $i &lt;= $totalRating; $i++) {
       if($starRating &lt; $i ) {
          echo "&lt;img src=\"/icons/star-empty.svg\"&gt;";
        }
        else {
          echo "&lt;img src=\"/icons/star.svg\"&gt;";
        }
      }
  ?&gt;
  </code></pre>
  
  <p>Ideally I would like to add a condition at the end of the loop and check for the half and echo "";</p>