+ 1
How to include 0 after decimal
val price = 32.50 println (price) result is 32.5 Desired result 32.50
2 Réponses
+ 8
In this case, you can round it off to two decimal places (#.##)
val price = 32.50
println ("%.2f".format(price))
More information is given here:
https://www.programiz.com/kotlin-programming/examples/round-number-decimal
+ 1
thank you that worked. as an unemployed learner i couldn't be more grateful for the help provided by the solo community. thanks again