I have a Float
that I'd like to format as a percentage. If it was C# then it would be f.ToString("P1")
. However, as far as I can tell, this is not possible in Kotlin.
The documentation is woefully inadeuate:
- https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/to-string.html
- https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/format.html
So do you all have to write your own number formatting code?