Answer the question
In order to leave comments, you need to log in
How to format an integer in Kotlin?
Good afternoon!
I have this code
var str: String = "%,d".format(1231)
The output is 1,231
How do I get the output 1231
Thank you very much in advance!
Answer the question
In order to leave comments, you need to log in
Denis Zagaevsky thanks for the answer!
This is how it works for me
var str: String = "%,d".format(Locale("RU"),1234)
println(str)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question