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.
String formatting
Format Double with a comma and 2 decimal digits
Report a typo
Sample Input 1:
1264.86453Sample Output 1:
1,264.86Write a program in Kotlin
fun main() {
val value = readln().toDouble()
// Change this line of code
val doubleString = String.format("%f",value)
println(doubleString )
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.