Update app.js

master
Andy Smy 2025-05-12 18:07:43 +01:00 committed by GitHub
parent fb274ac485
commit e8d355a207
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 > 10) batteryPercents.shift();
return Math.trunc(batteryPercents.reduce((avg,e,i,arr)=>avg+e/arr.length,0));
return Math.round(batteryPercents.reduce((avg,e,i,arr)=>avg+e/arr.length,0));
}
// process heart rate monitor event