From 62ed64015eefc83b70348e5b29ed67c94c5cba25 Mon Sep 17 00:00:00 2001 From: chrisala Date: Wed, 18 Dec 2024 14:46:53 +1100 Subject: [PATCH] Use score preference if specified for dashboard precision #3392 --- grails-app/taglib/au/org/ala/merit/DashboardTagLib.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grails-app/taglib/au/org/ala/merit/DashboardTagLib.groovy b/grails-app/taglib/au/org/ala/merit/DashboardTagLib.groovy index e5fbe6d35..e8b36fa17 100644 --- a/grails-app/taglib/au/org/ala/merit/DashboardTagLib.groovy +++ b/grails-app/taglib/au/org/ala/merit/DashboardTagLib.groovy @@ -147,10 +147,12 @@ class DashboardTagLib { percentComplete = Math.min(100, percentComplete) percentComplete = Math.max(0, percentComplete) + int maxDecimalPlaces = score.decimalPlaces != null ? score.decimalPlaces : 2 + out << """
- ${g.formatNumber(type:'number',number:result, maxFractionDigits: 2, groupingUsed:true)}/${g.formatNumber(type:'number',number:target, maxFractionDigits: 2, groupingUsed:true)} + ${g.formatNumber(type:'number',number:result, maxFractionDigits: maxDecimalPlaces, groupingUsed:true)}/${g.formatNumber(type:'number',number:target, maxFractionDigits: maxDecimalPlaces, groupingUsed:true)}
""" }