From f1c89e967af814ead287d2eb3d2973bfa972a947 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sun, 12 Mar 2023 11:07:42 +1100 Subject: [PATCH] Fix error thrown during calorie tracking --- templates/new_workout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/new_workout.html b/templates/new_workout.html index abd3db5..b8e5e67 100644 --- a/templates/new_workout.html +++ b/templates/new_workout.html @@ -378,10 +378,10 @@ const timeDiffSec = (endDate.getTime() - startDate.getTime()) / 1000; // Calculate the energy(joules) expended based on power and time difference - const energy = powerPerSec * timeDiffSec; + const energy = power * timeDiffSec; //Convert joules to calories - return energy * 0.238902957619; + return (energy * 0.238902957619) / 1000; }