/**
 * This function takes a number and a precision as inputs and returns a list of floating-point numbers
 * rounded to the given precision.
 *
 * @param num The number to be rounded.
 * @param precision The number of decimal places to round to.
 * @return A list of rounded floating-point numbers.
 *
 * Example:
 * createRoundedList(3.14159265359, 2)
 * Output: [3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14]
 */
fun createRoundedList(num: Double, precision: Int): List<Double> {

    val roundedList = List(10) { num.round(precision) }
    return roundedList
}

private fun Double.round(precision: Int): Double = "%.${precision}f".format(this).toDouble()
/**
 * This function takes a number and a precision as inputs and returns a list of floating-point numbers
 * rounded to the given precision.
 *
 * @param num The number to be rounded.
 * @param precision The number of decimal places to round to.
 * @return A list of rounded floating-point numbers.
 *
 * Example:
 * createRoundedList(3.14159265359, 2)
 * Output: [3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14]
 */
fun createRoundedList(num: Double, precision: Int): List<Double> {
/**
 * This function takes a number and a precision as inputs and returns a list of floating-point numbers
 * rounded to the given precision.
 *
 * @param num The number to be rounded.
 * @param precision The number of decimal places to round to.
 * @return A list of rounded floating-point numbers.
 *
 * Example:
 * createRoundedList(3.14159265359, 2)
 * Output: [3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14, 3.14]
 */
fun createRoundedList(num: Double, precision: Int): List<Double> {

    val roundedList = List(10) { num.round(precision) }
    return roundedList
}

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