Hello @cansnips
The code would be very similar:
IF(fieldname7*fieldname16-1000<=0, '', PREC(fieldname7*fieldname16-1000, 2))
Best regards.
Hello,
When dealing with IF statements, how can possibly do this?
If the calculated BMI is within 18.5 – 24.9, my html content field would say:
You’re at Normal weight
If the calculated BMI is within 25 – 29.9, my html content field would say:
You’re Overweight.
I was able to do this type of condition with an easier one (actual BMI), using this:
(function(){
var result = prec(fieldname6/fieldname1, 2);
jQuery('#result_here').html(result);
return result;
})();
HTML content:
<p>Based on your Height and Weight, your BMI is <span id="result_here"></span>.
</p>
But where I’m struggling at is at saving and showing a certain verbiage when a condition on the BMI value is met.
-
This reply was modified 5 years, 8 months ago by
jfool.
-
This reply was modified 5 years, 8 months ago by
jfool.
Hello @jfool
The equation should be edited as follows:
(function(){
var result = fieldname6/fieldname1, mssg = "";
if(AND(18.5<=result, result<=24.9)) mssg = "You're at Normal weight";
else if(AND(24.9<result, result<=29.9)) mssg = "You're Overweight";
jQuery('#result_here').html(mssg);
return PREC(result, 2);
})();
Best regards.
Thank you so much!
How about when I will combine the BMI and mssg in one blurb? Let’s say:
Based on your Height and Weight, your BMI is *result* = *mssg* (Asia-Pacific)
Is that doable?
-
This reply was modified 5 years, 8 months ago by
jfool.
Hello @jfool
You can call the CONCATENATE operation passing both values as parameters.
Best regards.