mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-27 11:19:21 -04:00
Improve number formatting on platform-admin page
Minor changes to the number formatting for the `/platform-admin` page to - Show the complaint percentage to 2 decimal places. (The number of complaints is often below 0.0% so 1 decimal place isn't useful) - Format the numbers in the status boxes to use a comma as a thousands separator.
This commit is contained in:
@@ -52,6 +52,13 @@ def get_formatted_percentage(x, tot):
|
||||
return "{0:.1f}".format((float(x) / tot * 100)) if tot else '0'
|
||||
|
||||
|
||||
def get_formatted_percentage_two_dp(x, tot):
|
||||
"""
|
||||
Return a percentage to two decimal places
|
||||
"""
|
||||
return "{0:.2f}".format((float(x) / tot * 100)) if tot else '0'
|
||||
|
||||
|
||||
def statistics_by_state(statistics):
|
||||
return {
|
||||
'sms': {
|
||||
|
||||
Reference in New Issue
Block a user