From 2accf8434a83c8a325fcb56ce879c61f855a9e80 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 24 Jun 2021 16:54:08 +0100 Subject: [PATCH] Remove false precision from area estimates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/__init__.py | 2 ++ .../views/broadcast/macros/area-map.html | 4 +-- tests/app/main/views/test_broadcast.py | 32 +++++++++---------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 75fb80518..74dabc698 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -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, diff --git a/app/templates/views/broadcast/macros/area-map.html b/app/templates/views/broadcast/macros/area-map.html index 04645eb2a..289bb24e3 100644 --- a/app/templates/views/broadcast/macros/area-map.html +++ b/app/templates/views/broadcast/macros/area-map.html @@ -3,7 +3,7 @@