fix: round average rating to display correct number of stars

This commit is contained in:
Björn Fromme
2024-07-22 18:17:44 +02:00
parent dd1c560ba4
commit f3316e2392
+1 -1
View File
@@ -1,5 +1,5 @@
<div class="inline-flex items-center">
{% for grade in range(1, 5) %}
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': rating < grade * 100, 'text-primary': rating >= grade * 100 })) }}
{{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': (rating/100)|round < grade, 'text-primary': (rating/100)|round >= grade })) }}
{% endfor %}
</div>