Mercurial > gemma
diff client/src/components/identify/Identify.vue @ 4401:9842812b92e0
identify: fix numbers for nsc
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 16 Sep 2019 16:46:29 +0200 |
parents | 5356fd2ea3f6 |
children | a66275cf4490 |
line wrap: on
line diff
--- a/client/src/components/identify/Identify.vue Mon Sep 16 16:41:56 2019 +0200 +++ b/client/src/components/identify/Identify.vue Mon Sep 16 16:46:29 2019 +0200 @@ -5,7 +5,7 @@ { expanded: showIdentify } ]" > - <div style="width: 18rem"> + <div style="width: 20rem"> <UIBoxHeader icon="info" :title="identifiedLabel" @@ -262,10 +262,18 @@ return forecastVsRealityColorCodes[this.gaugeStatus]; }, gaugeStatusText() { - const nsc24 = this.config.gm_forecast_vs_reality_nsc_24h; - const nsc72 = this.config.gm_forecast_vs_reality_nsc_72h; - const coeffWarn = this.gaugeCoeffs ? this.gaugeCoeffs[2].value : ""; - const coeffDanger = this.gaugeCoeffs ? this.gaugeCoeffs[0].value : ""; + const nsc24 = Number(this.config.gm_forecast_vs_reality_nsc_24h).toFixed( + 2 + ); + const nsc72 = Number(this.config.gm_forecast_vs_reality_nsc_72h).toFixed( + 2 + ); + const coeffWarn = this.gaugeCoeffs + ? Number(this.gaugeCoeffs[2].value).toFixed(2) + : ""; + const coeffDanger = this.gaugeCoeffs + ? Number(this.gaugeCoeffs[0].value).toFixed(2) + : ""; const messagesPerState = { OK: this.$gettext("Nash-Sutcliffe") + @@ -283,11 +291,17 @@ return forecastVsRealityColorCodes[this.refGaugeStatus]; }, refGaugeStatusText() { - const nsc24 = this.config.gm_forecast_vs_reality_nsc_24h; - const nsc72 = this.config.gm_forecast_vs_reality_nsc_72h; - const coeffWarn = this.refGaugeCoeffs ? this.refGaugeCoeffs[2].value : ""; + const nsc24 = Number(this.config.gm_forecast_vs_reality_nsc_24h).toFixed( + 2 + ); + const nsc72 = Number(this.config.gm_forecast_vs_reality_nsc_72h).toFixed( + 2 + ); + const coeffWarn = this.refGaugeCoeffs + ? Number(this.refGaugeCoeffs[2].value).toFixed(2) + : ""; const coeffDanger = this.refGaugeCoeffs - ? this.refGaugeCoeffs[0].value + ? Number(this.refGaugeCoeffs[0].value).toFixed(2) : ""; const messagesPerState = { OK: