fix: prevent rounding errors

This commit is contained in:
2023-09-04 19:20:30 +00:00
parent 0b71389669
commit 6ee4737fc4

View File

@@ -91,13 +91,8 @@
</thead>
<tbody>
{% for entry in model.calculator.entries %}
{% set duration = entry.duration|duration(isDecimal) %}
{% if entry.fixedRate %}
{% set rate = entry.fixedRate %}
{% set duration = entry.amount/8.5|amount %}
{% else %}
{% set days = entry.duration // (60*60*8.5)%}
{% set rate = entry.hourlyRate*8.5 %}
{% endif %}
<tr>
<!---
<td nowrap class="text-nowrap">{{ entry.begin|date_short }}</td>
@@ -111,7 +106,7 @@
</td>
<td nowrap class="text-nowrap text-right"></td>
<td nowrap class="text-nowrap text-right">{{ rate|money(currency) }}</td>
<td nowrap class="text-nowrap text-right">{{ duration/8.5 }}</td>
<td nowrap class="text-nowrap text-right">{{ days }}</td>
<td nowrap class="text-nowrap text-right">{{ entry.rate|money(currency) }}</td>
</tr>
{% endfor %}