Kotlin Discussions
Format a double to fixed decimal length
Support
dominik.reber11
November 28, 2020, 1:11pm
2
Oh I got it:
String.format(“%.3f”, MyDecimalValue)
2 Likes
show post in topic
Related topics
Topic
Replies
Views
Activity
How do you round a number to N decimal places
Support
18
249577
May 20, 2024
Print floats with certain amount of decimal numbers
Support
5
61174
December 7, 2023
Kotlin compiler apparently losing Double value precision
4
5067
July 31, 2024
1.20 + 1.23 = 2.42999997
Support
7
4202
February 20, 2019
"%.#f".format function return value with "comma" separator, I need it with "dot" separator
Android
2
14079
November 21, 2017