/**
 * Calculates the body mass index (BMI) using the given height and weight.
 *
 * @param height The height in meters
 * @param weight The weight in kilograms
 * @return The BMI value rounded to two decimal places
 */
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()
/**
 * Calculates the body mass index (BMI) using the given height and weight.
 *
 * @param height The height in meters
 * @param weight The weight in kilograms
 * @return The BMI value rounded to two decimal places
 */
fun calculateBmi(height: Double, weight: Double): Double {
/**
 * Calculates the body mass index (BMI) using the given height and weight.
 *
 * @param height The height in meters
 * @param weight The weight in kilograms
 * @return The BMI value rounded to two decimal places
 */
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()