Separate thousands with comma for big numbers

Makes it easier to see just how big the numbers are.
This commit is contained in:
Chris Hill-Scott
2016-04-25 11:33:40 +01:00
parent 0cc499bce4
commit 683baa0003

View File

@@ -1,6 +1,10 @@
{% macro big_number(number, label) %}
<div class="big-number">
{{ number }}
<div class="big-number{% if right_aligned %}-right-aligned{% endif %}">
{% if number is number %}
{{ "{:,}".format(number) }}
{% else %}
{{ number }}
{% endif %}
<span class="big-number-label">{{ label }}</span>
</div>
{% endmacro %}
@@ -13,10 +17,10 @@
{% if failures %}
{% if failure_link %}
<a href="{{ failure_link }}">
{{ failures }} failed {{ failure_percentage }}%
{{ "{:,}".format(failures) }} failed {{ failure_percentage }}%
</a>
{% else %}
{{ failures }} failed {{ failure_percentage }}%
{{ "{:,}".format(failures) }} failed {{ failure_percentage }}%
{% endif %}
{% else %}
No failures