{% for i in 0..4 %} {% if ratingStars >= i + 1 %} {% elseif ratingStars >= i + 0.5 %} {% else %} {% endif %} {% endfor %} {{ ratingStars }}