Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Nov 16, 2023
1 parent f53944e commit 5d0e2a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,12 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Users in Al

<tbody>
{% for user in allocation_users %}
{% if user.unit not "CPU Hours" %}
{% if user.unit == "CPU Hours" %}
{% user.usage_bytes as userusage %}
{% allocation.usage_exact as allocationusage %}
{% allocation.usage as allocationusage %}
{% else %}
{% user.usage_bytes as userusage %}
{% allocation.usage_exact as allocationusage %}
{% endif %}
<tr status = "{{ user.status }}">
<td>{{ user.user.first_name }} {{ user.user.last_name }}</td>
Expand All @@ -489,7 +490,7 @@ <h3 class="d-inline"><i class="fas fa-users" aria-hidden="true"></i> Users in Al
{% else %}
<td>{{userusage|div:allocationusage|mul:100|floatformat:2 }}%</td>
{% endif %}
{% if if user.unit not "CPU Hours" %}
{% if if user.unit == "CPU Hours" %}
{% cost_cpuhours userusage as cost %}
{% else %}
{% cost_bytes userusage as cost %}
Expand Down
2 changes: 1 addition & 1 deletion coldfront/core/utils/templatetags/fasrc_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def cost_tb(context, amount):
def cost_cpuhours(context, amount):
a_price = get_resource_rate(context['allocation'].get_resources_as_string)
if a_price:
return "${:,.2f}".format(a_price * amount)
return "${:,.2f}".format(float(a_price) * amount)
return None

0 comments on commit 5d0e2a8

Please sign in to comment.