Dynamic Double formatting

Report a typo

The function doubleFormat(value: Double, width: Int, precision: Int) formats a string of the value number, with the width equal to width and the number of decimal digits equal to precision.

Complete the code of the function.

Sample input provides the arguments passed to the doubleFormat() function.

Sample Input 1:

672.457 7 1

Sample Output 1:

  672.5
Write a program in Kotlin
fun doubleFormat(value: Double, width: Int, precision: Int): String {
// write your code here

}
___

Create a free account to access the full topic