Summary

This article covers the bmi command. 


Description

This command calculates a BMI using the US, SI, or UK formula. The default formula is the US formula.

Attributes

  • None

Parameters

  • weight – (number) See the ‘formula’ parameter for information on units.
  • height – (number) See the ‘formula’ parameter for information on units.
  • formula – (string) The formula can be specified as either ‘US’,’SI’ or ‘UK’. The ‘SI’ formula uses height in meters, and weight in kilograms. The ‘US’ formula uses weight in pounds, and height in inches. The ‘UK’ formula uses weight in stones, and height in meters.
The actual mathematical formulas used to do the calculations of the BMI values are as follows:
SI – weight / (height)2
UK – 6.35 x (weight / (height)2)
US – 703 x (weight / (height)2)


Example

<script scriptId="bmi-calculation">
    <body>
        <s:if>https://help.datatrak.net/wp-admin/edit.php?s=Commands&post_status=all&post_type=page&action=-1&m=0&action2=-1&orderby=title&order=asc
            <s:isSet>
                <s:question>
                    <s:list>
                        <s:string value=".weight"/>
                        <s:string value=".height"/>
                        <s:string value=".unit"/>
                    </s:list>
                </s:question>
            </s:isSet>
            <s:if>
                <s:eq>
                    <s:stringPath path=".unit:value"/>
                    <s:string value="US"/>
                </s:eq>
                <s:assign>
                    <s:question path=".bmi"/>
                    
                    <s:bmi>
                        <s:weight>
                            <s:numberPath path=".weight:value"/>
                        </s:weight>
                        <s:height>
                            <s:numberPath path=".height:value"/>
                        </s:height>
                        <s:formula>
                            <s:string value="US"/>
                        </s:formula>
                    </s:bmi>
                    
                </s:assign>
                <s:assign>
                    <s:question path=".bmi"/>
                    
                    <s:bmi>
                        <s:weight>
                            <s:numberPath path=".weight:value"/>
                        </s:weight>
                        <s:height>
                            <s:numberPath path=".height:value"/>
                        </s:height>
                        <s:formula>
                            <s:string value="SI"/>
                        </s:formula>
                    </s:bmi>
                    
                </s:assign>
            </s:if>
        </s:if>
    </body>
    <target typeId="height" when="preprocess" shouldReconcile='true' />
    <target typeId="weight" when="preprocess" shouldReconcile='true' />
    <target typeId="unit" when="preprocess" shouldReconcile='true' />
</script>


Need more help?

Please visit the Fountayn Contact Information page.