mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Format numbers in templates
This commit is contained in:
parent
9236c13213
commit
79f24b7cb8
3 changed files with 4 additions and 4 deletions
|
@ -45,7 +45,7 @@ class Project(db.Model):
|
||||||
|
|
||||||
for person in self.members:
|
for person in self.members:
|
||||||
balance = should_receive[person] - should_pay[person]
|
balance = should_receive[person] - should_pay[person]
|
||||||
balances[person.id] = round(balance, 2)
|
balances[person.id] = balance
|
||||||
|
|
||||||
return balances
|
return balances
|
||||||
|
|
||||||
|
|
|
@ -73,8 +73,8 @@
|
||||||
<form class="action reactivate" action="{{ url_for(".reactivate", member_id=member.id) }}" method="POST">
|
<form class="action reactivate" action="{{ url_for(".reactivate", member_id=member.id) }}" method="POST">
|
||||||
<button type="submit">{{ _("reactivate") }}</button></form></td>
|
<button type="submit">{{ _("reactivate") }}</button></form></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="balance-value {% if balance[member] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
|
<td class="balance-value {% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
|
||||||
{% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }}
|
{% if balance[member.id] > 0 %}+{% endif %}{{ "%.2f" | format(balance[member.id]) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<tr id="bal-member-{{ member.id }}" action={% if member.activated %}delete{% else %}reactivate{% endif %}>
|
<tr id="bal-member-{{ member.id }}" action={% if member.activated %}delete{% else %}reactivate{% endif %}>
|
||||||
<td class="balance-name">{{ member.name }}</td>
|
<td class="balance-name">{{ member.name }}</td>
|
||||||
<td class="balance-value {% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
|
<td class="balance-value {% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
|
||||||
{% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }}
|
{% if balance[member.id] > 0 %}+{% endif %}{{ "%.2f" | format(balance[member.id]) }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue