Fix rounding in precipitation percentage (#3045)

Percentage should be always rounded so that we dont get something like
"47.0000000001 %"

Some small typo and naming fixes also while I am here

---------

Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
Veeck
2023-02-20 20:04:40 +01:00
committed by GitHub
parent 390e5d6490
commit 6d86ffade4
6 changed files with 21 additions and 19 deletions

View File

@@ -40,7 +40,7 @@ const WeatherUtils = {
valueUnit = valueUnit ? valueUnit : "mm";
}
if (valueUnit === "%") return `${value}${valueUnit}`;
if (valueUnit === "%") return `${value.toFixed(0)} ${valueUnit}`;
return `${value.toFixed(2)} ${valueUnit}`;
},