bugfix: hr zone display if zone is below 1

This commit is contained in:
Gyuri Horák 2023-10-20 12:25:26 +02:00
parent 26418b0d6c
commit 50d65c7858
Signed by: dyuri
GPG Key ID: 4993F07B3EAE8D38
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<properties>
<property id="appVersion" type="string">1.1.0</property>
<property id="appVersion" type="string">1.1.1</property>
<property id="themeColor" type="string">0</property>
<property id="themeColor2" type="string">0088FF</property>
<property id="themeColor3" type="string">FFFF00</property>

View File

@ -19,7 +19,9 @@ function displayHr(hr as Number, type as Number, zones as Array<Number>) as Stri
} else if (type == 2) {
var hrzsize = zones.size();
for (var i = 0; i < hrzsize; i++) {
if (hr < zones[i] || i == hrzsize - 1) {
if (i == 0 && hr < zones[i]) {
return "-";
} else if (hr < zones[i] || i == hrzsize - 1) {
return ((hr - zones[i - 1]) / (zones[i] - zones[i - 1]).toFloat() + i).format("%.1f");
}
}