/**
 * Calculate the Body Mass Index (BMI) of a patient, given their height and weight.
 *
 * @param height the height of the patient in meters
 * @param weight the weight of the patient in kilograms
 * @return The calculated BMI as a floating-point number.
 */
fun calculateBmi(height: Double, weight: Double): Double {

    val bmi = weight / (height * height)
    return bmi.round(2)
}

fun Double.round(decimals: Int): Double = "%.${decimals}f".format(this).toDouble()
/**
 * Calculate the Body Mass Index (BMI) of a patient, given their height and weight.
 *
 * @param height the height of the patient in meters
 * @param weight the weight of the patient in kilograms
 * @return The calculated BMI as a floating-point number.
 */
fun calculateBmi(height: Double, weight: Double): Double {
/**
 * Calculate the Body Mass Index (BMI) of a patient, given their height and weight.
 *
 * @param height the height of the patient in meters
 * @param weight the weight of the patient in kilograms
 * @return The calculated BMI as a floating-point number.
 */
fun calculateBmi(height: Double, weight: Double): Double {

    val bmi = weight / (height * height)
    return bmi.round(2)
}

fun Double.round(decimals: Int): Double = "%.${decimals}f".format(this).toDouble()