Skip to content

Commit

Permalink
Use score preference if specified for dashboard precision #3392
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Dec 18, 2024
1 parent cc501b4 commit 62ed640
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion grails-app/taglib/au/org/ala/merit/DashboardTagLib.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 << """
<div class="progress progress-info active " style="position:relative">
<div class="${progressBarClass}" style="width: ${percentComplete}%;"></div>
<span class="pull-right progress-label ${percentComplete >= 99 ? 'progress-100':''}" style="position:absolute; top:0; right:0;"> ${g.formatNumber(type:'number',number:result, maxFractionDigits: 2, groupingUsed:true)}/${g.formatNumber(type:'number',number:target, maxFractionDigits: 2, groupingUsed:true)}</span>
<span class="pull-right progress-label ${percentComplete >= 99 ? 'progress-100':''}" style="position:absolute; top:0; right:0;"> ${g.formatNumber(type:'number',number:result, maxFractionDigits: maxDecimalPlaces, groupingUsed:true)}/${g.formatNumber(type:'number',number:target, maxFractionDigits: maxDecimalPlaces, groupingUsed:true)}</span>
</div>"""
}

Expand Down

0 comments on commit 62ed640

Please sign in to comment.