From 20f32bd7e09039723aca1b336791fa94848e7027 Mon Sep 17 00:00:00 2001 From: Yue-Long Date: Thu, 22 Aug 2024 10:54:31 +0100 Subject: [PATCH] feat: cap National Report Coverage to 2 decimal --- app/presenters/statistic_presenter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/presenters/statistic_presenter.rb b/app/presenters/statistic_presenter.rb index 038a88e2d..ba0b17475 100644 --- a/app/presenters/statistic_presenter.rb +++ b/app/presenters/statistic_presenter.rb @@ -51,7 +51,7 @@ def method_missing method nr_stat = "percentage_nr_#{land_type}_cover".to_sym define_method(nr_stat) do - (@statistic.send(nr_stat) && @statistic.send(nr_stat) > 100.0) ? 100.0 : @statistic.send(nr_stat).round(0) rescue nil + (@statistic.send(nr_stat) && @statistic.send(nr_stat) > 100.0) ? 100.0 : @statistic.send(nr_stat).round(2) rescue nil end percent_oecm_stat = "percentage_oecms_pa_#{land_type}_cover".to_sym