mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 00:20:43 -04:00
Remove false precision from area estimates
We give estimates of the area for those who can’t see the map. These estimates were needlessly precise, gave a false sense of accuracy and were causing intermittent test failures between different environments. This commit rounds them in the same way that we round the count of phones.
This commit is contained in:
@@ -72,6 +72,7 @@ from app.formatters import (
|
||||
nl2br,
|
||||
recipient_count,
|
||||
recipient_count_label,
|
||||
round_to_significant_figures,
|
||||
valid_phone_number,
|
||||
)
|
||||
from app.models.organisation import Organisation
|
||||
@@ -564,6 +565,7 @@ def add_template_filters(application):
|
||||
iteration_count,
|
||||
recipient_count,
|
||||
recipient_count_label,
|
||||
round_to_significant_figures,
|
||||
message_count_label,
|
||||
message_count,
|
||||
message_count_noun,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ul>
|
||||
<li class="area-list-key area-list-key--certain">
|
||||
<span class="visually-hidden">
|
||||
An area of {{ "{:,.1f}".format(broadcast_message.simple_polygons.estimated_area) }} square miles
|
||||
An area of {{ (broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles
|
||||
</span>
|
||||
Will get
|
||||
<span class="visually-hidden">the</span>
|
||||
@@ -11,7 +11,7 @@
|
||||
</li>
|
||||
<li class="area-list-key area-list-key--likely">
|
||||
<span class="visually-hidden">
|
||||
An extra area of {{ "{:,.1f}".format(broadcast_message.simple_polygons_with_bleed.estimated_area - broadcast_message.simple_polygons.estimated_area) }} square miles is
|
||||
An extra area of {{ (broadcast_message.simple_polygons_with_bleed.estimated_area - broadcast_message.simple_polygons.estimated_area)|round_to_significant_figures(1)|format_thousands }} square miles is
|
||||
</span>
|
||||
Likely to get
|
||||
<span class="visually-hidden">
|
||||
|
||||
Reference in New Issue
Block a user