Skip to content

Commit

Permalink
site: Use optint for dpm/hpm/hgm
Browse files Browse the repository at this point in the history
When the duration is 0, we dpm/hmp/hgm will be None. Use optint to make
this clearer, instead of coercing to 0.

Signed-off-by: Sean Anderson <[email protected]>
  • Loading branch information
Forty-Bot committed Dec 16, 2023
1 parent c0f01f9 commit fe2dcbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions trends/site/templates/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<td>{{ cls['kills'] }}</td>
<td>{{ cls['deaths'] }}</td>
<td>{{ cls['assists'] }}</td>
<td>{{ cls['dpm'] | int }}</td>
<td>{{ optint(cls['dpm']) }}</td>
<td colspan="{{ 1 + has['dt'] }}"></td>
<td>{{ cls['dmg'] }}</td>
{# +2 for heal/lks #}
Expand Down Expand Up @@ -169,11 +169,11 @@
<td>{{ row['kills'] }}</td>
<td>{{ row['deaths'] }}</td>
<td>{{ row['assists'] }}</td>
<td>{{ row['dpm'] | int }}</td>
<td>{{ optint(row['dpm']) }}</td>
{% if has['dt'] %}
<td>{{ optint(row['dtm']) }}</td>
{% endif %}
<td>{{ row['hpm'] | int }}</td>
<td>{{ optint(row['hpm']) }}</td>
<td>{{ row['dmg'] }}</td>
{% macro optcol(col) %}
{% if has[col] %}
Expand Down
6 changes: 3 additions & 3 deletions trends/site/templates/macros/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
<td>{{ log['kills'] }}</td>
<td>{{ log['deaths'] }}</td>
<td>{{ log['assists'] }}</td>
<td>{{ log['dpm'] | int }}</td>
<td>{{ optint(log['dpm']) }}</td>
<td>{{ optint(log['dtm']) }}</td>
<td>{{ log['hpm_given'] | int }}</td>
<td>{{ log['hpm_recieved'] | int }}</td>
<td>{{ optint(log['hpm_given']) }}</td>
<td>{{ optint(log['hpm_recieved']) }}</td>
<td>{{ optformat("{:.0%}", log['acc']) }}</td>
{{ datetime_col(log['time']) }}
{% if extra %}
Expand Down

0 comments on commit fe2dcbc

Please sign in to comment.