Update app.js

master
Andy Smy 2025-05-12 17:19:12 +01:00 committed by GitHub
parent 1dcfc8ebe0
commit 1b38f94232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ function toggleHRM() {
function getBattery() {
batteryPercents.push(E.getBattery());
if(batteryPercents.length > 20) batteryPercents.shift();
return batteryPercents.reduce((avg,e,i,arr)=>avg+e/arr.length,0).trunc(0);
return Math.trunc(batteryPercents.reduce((avg,e,i,arr)=>avg+e/arr.length,0));
}
// process heart rate monitor event