I’m looking to create a TDEE Calculator where the clients give me their age, height (in inches), weight (lbs), and activity level (the 5 different options then would = a number assigned for calculation).
This would save me a ton of time for my clients vs having to do it manually. I have seen @amy.carlson’s BMI calculator from a year ago and tried to use that as reference, but after trying this now multiple times unsuccessfully, I wanted to reach out here to see if anyone could help!
Appreciate your time and any feedback,
Jace
Best answer by john.desborough
@jacef - i did three different variations of the form as follows and got the same output at 2 decimal level - it seems that it won’t go beyond that at this time in the form.. approaches and comments:
this version rounded the input variables for the activity level multiplier up to two digits ie 1.375 became 1.38 when i tried to enter the 3 digits into multiplier field (see image
this version i initially multiplied the activity variables by 1000 to start with so that they were not three decimal places long, and then divided the results by 1000 to see if it would not end up with result at two decimals (see image)
in this version, i tried to create variables for the 5 activity levels at the 3 decimal points in the value but it rounds them up to 2 digit..
the only way around the two activity multipliers that i can think of is to calculate along the lines as follows (using 1.375 as example)
multiply bmr by 1.37 and add result to v_LA
multiply bmr by 1.38 and add result to v_LA
divide v_LA by 2 to get the average
however, i believe the output will still be limited to two decimal points which may end up with the same rolled up .. and i have run out of time to test that today.. i will leave you to think it through..
have a look at these three samples and tell me if i got it in the ballpark - understanding there will be a rounding error .. i can walk you through the logic in screen shots if that is where you are heading
Hi, I’m new here. While searching for a calorie counter to add to a new programme, I came across this one, and it’s spot on! Thank you so much to everyone who made this happen. The calculator works, but I just want to ensure that I’ve entered the correct values for the variables and that the calculations are accurate. When I compare it to other online counters, it shows around 400 calories more. I haven’t added a number next to the @tdee_men or @tdee_woman variable is that the right thing to do? Any help is much appreciated. Thank you