<div class="rating rating--md {{ isTextWhite is defined ? 'rating--white': '' }} {{ styleModifier }}">
<div class="trustyou-logo mb-1"><span class="sr-only">TrustYou Rating</span></div>
<div class="rating__score">{{ score }}</div>
<div class="rating__content">
<div class="rating__text">
{{ text }}
</div>
<div class="rating-stars">
{# @var (float)#}
{% set totalRating = score %}
{% set maxStars = 5 %}
{#round stars to next .5-step #}
{% set normalizedTotalRating = (totalRating * 2 | round) / 2 %}
{# floor normalizedRating to next int #}
{% set fullTotalStars = normalizedTotalRating | round(0, 'floor') %}
{% set halfTotalStar = normalizedTotalRating - fullTotalStars > 0 %}
{% set emptyTotalStars = maxStars - fullTotalStars %}
{% for s in 1..fullTotalStars %}
<span class="rating-star"></span>
{% endfor %}
{% if halfTotalStar %}
{% set emptyTotalStars = emptyTotalStars - 1 %}
<span class="rating-star rating-star--half"></span>
{% endif %}
{% if emptyTotalStars > 0 %}
{% for e in 1..emptyTotalStars %}
<span class="rating-star rating-star--empty"></span>
{% endfor %}
{% endif %}
</div>
{% if showReviewCount %}
<span class="rating__count text-muted">
({{ ratingCount }} {{ ratingCount > 1 ? 'demi.ratings'|trans : 'demi.rating'|trans}})
</span>
{% endif %}
</div>
</div>