Format Double with a comma and 2 decimal digits

Report a typo

This program should read a Double number and print it with a thousand separator and exactly 2 decimal digits (see the sample input and output). Correct the format string in order to achieve the described behavior.

Sample Input 1:

1264.86453

Sample Output 1:

1,264.86
Write a program in Kotlin
fun main() {
val value = readln().toDouble()

// Change this line of code
val doubleString = String.format("%f",value)

println(doubleString )
}
___

Create a free account to access the full topic