Skip to content

Commit ab465de

Browse files
Increase minimum change required for label to appear (#80)
This prevents "empty" change when change was greater then zero but was then rounded to less than 0.00
2 parents 3eb3a09 + 2d25d53 commit ab465de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

template.html.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ main | <a href="metadata.html" target="_self">meta</a>
4242
<div class="progress-bar"
4343
style="width: {{ project.completion }}%;{% if project.change %}background: linear-gradient(to left, #94cf96 {{ project.change * 100 / project.completion }}%, #4caf50 {{ project.change * 100 / project.completion }}%);{% else %}background-color: #4caf50;{% endif %}"
4444
>
45-
{{ '{:.2f}%'.format(project.completion) }} {% if project.change > 0 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
45+
{{ '{:.2f}%'.format(project.completion) }} {% if project.change >= 0.01 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
4646
</div>
4747
<div class="progress-bar-outer-label">
48-
{{ '{:.2f}%'.format(project.completion) }} {% if project.change > 0 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
48+
{{ '{:.2f}%'.format(project.completion) }} {% if project.change >= 0.01 %}({{ '{:+.2f}%'.format(project.change) }}){% endif %}
4949
</div>
5050
</td>
5151
</tr>

0 commit comments

Comments
 (0)