Skip to content

Commit

Permalink
Merge pull request #1743 from 18F/caleywoods/utilization-format-fix
Browse files Browse the repository at this point in the history
Replace deprecated applymap() and use two decimal places for formatting
  • Loading branch information
Caley Woods authored Apr 11, 2024
2 parents bae914e + 796a23a commit c6b7bc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tock/utilization/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,5 @@ def project_chart_and_table(timecardobject_queryset):
# is more typical, so let's replace the NaNs with zeroes before we
# format the numbers
datatable = datatable.fillna(0)
datatable = datatable.map("{:.0f}".format)
datatable = datatable.map("{:.2f}".format)
return plot_div, datatable
2 changes: 1 addition & 1 deletion tock/utilization/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def get_context_data(self, **kwargs):
"headcount_data": headcount_data_frame.pivot(
index="start_date", values="headcount", columns="organization"
)
.applymap("{:.0f}".format)
.map("{:.0f}".format)
.replace("nan", ""),

# we use mark_safe intentionally here because we trust that
Expand Down

0 comments on commit c6b7bc9

Please sign in to comment.