Fix error thrown during calorie tracking

This commit is contained in:
Peter Stockings
2023-03-12 11:07:42 +11:00
parent d7fd30a3c8
commit f1c89e967a

View File

@@ -378,10 +378,10 @@
const timeDiffSec = (endDate.getTime() - startDate.getTime()) / 1000; const timeDiffSec = (endDate.getTime() - startDate.getTime()) / 1000;
// Calculate the energy(joules) expended based on power and time difference // Calculate the energy(joules) expended based on power and time difference
const energy = powerPerSec * timeDiffSec; const energy = power * timeDiffSec;
//Convert joules to calories //Convert joules to calories
return energy * 0.238902957619; return (energy * 0.238902957619) / 1000;
} }
</script> </script>