mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-30 18:22:38 +02:00
use currency format everywhere (#619)
This should unify the number formats, along with #618
This commit is contained in:
parent
b9672d9e15
commit
ca7c3d5452
3 changed files with 10 additions and 8 deletions
|
@ -25,7 +25,7 @@
|
||||||
<tr receiver={{bill.receiver.id}}>
|
<tr receiver={{bill.receiver.id}}>
|
||||||
<td>{{ bill.ower }}</td>
|
<td>{{ bill.ower }}</td>
|
||||||
<td>{{ bill.receiver }}</td>
|
<td>{{ bill.receiver }}</td>
|
||||||
<td>{{ "%0.2f"|format(bill.amount) }}</td>
|
<td>{{ bill.amount|currencyformat_nc(g.project.default_currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
{% for stat in members_stats|sort(attribute='member.name') %}
|
{% for stat in members_stats|sort(attribute='member.name') %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="d-md-none">{{ stat.member.name }}</td>
|
<td class="d-md-none">{{ stat.member.name }}</td>
|
||||||
<td>{{ "%0.2f"|format(stat.paid) }}</td>
|
<td>{{ stat.paid|currencyformat_nc(g.project.default_currency) }}</td>
|
||||||
<td>{{ "%0.2f"|format(stat.spent) }}</td>
|
<td>{{ stat.spent|currencyformat_nc(g.project.default_currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
{% for month in months %}
|
{% for month in months %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ _(month.strftime("%B")) }} {{ month.year }}</td>
|
<td>{{ _(month.strftime("%B")) }} {{ month.year }}</td>
|
||||||
<td>{{ "%0.2f"|format(monthly_stats[month.year][month.month]) }}</td>
|
<td>{{ monthly_stats[month.year][month.month]|currencyformat_nc(g.project.default_currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -942,16 +942,18 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
response = self.client.get("/raclette/statistics")
|
response = self.client.get("/raclette/statistics")
|
||||||
regex = r"<td class=\"d-md-none\">{}</td>\s+<td>{}</td>\s+<td>{}</td>"
|
regex = r"<td class=\"d-md-none\">{}</td>\s+<td>{}</td>\s+<td>{}</td>"
|
||||||
self.assertRegex(
|
self.assertRegex(
|
||||||
response.data.decode("utf-8"), regex.format("zorglub", "20.00", "31.67"),
|
response.data.decode("utf-8"),
|
||||||
|
regex.format("zorglub", r"\$20\.00", r"\$31\.67"),
|
||||||
)
|
)
|
||||||
self.assertRegex(
|
self.assertRegex(
|
||||||
response.data.decode("utf-8"), regex.format("fred", "20.00", "5.83"),
|
response.data.decode("utf-8"),
|
||||||
|
regex.format("fred", r"\$20\.00", r"\$5\.83"),
|
||||||
)
|
)
|
||||||
self.assertRegex(
|
self.assertRegex(
|
||||||
response.data.decode("utf-8"), regex.format("tata", "0.00", "2.50"),
|
response.data.decode("utf-8"), regex.format("tata", r"\$0\.00", r"\$2\.50"),
|
||||||
)
|
)
|
||||||
self.assertRegex(
|
self.assertRegex(
|
||||||
response.data.decode("utf-8"), regex.format("pépé", "0.00", "0.00"),
|
response.data.decode("utf-8"), regex.format("pépé", r"\$0\.00", r"\$0\.00"),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check that the order of participants in the sidebar table is the
|
# Check that the order of participants in the sidebar table is the
|
||||||
|
|
Loading…
Reference in a new issue