Here you can find the source of calcBMI(BigDecimal lbs, BigDecimal inches)
Parameter | Description |
---|---|
lbs | a parameter |
inches | a parameter |
public static String calcBMI(BigDecimal lbs, BigDecimal inches)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**//from ww w . j a va 2 s . c o m * Calc BMI consistent with CPRS to two decimal places. * @param lbs * @param inches * @return */ public static String calcBMI(BigDecimal lbs, BigDecimal inches) { BigDecimal bmi = BigDecimal.valueOf(lbs.doubleValue() / 2.2).divide( BigDecimal.valueOf(inches.doubleValue() * inches.doubleValue() / 1550.0031000062), 2, BigDecimal.ROUND_HALF_UP); return bmi.toString(); } }