Lilly
09/25/2021, 10:06 PMval value: UInt = 137
println("Value: ${value / 10F}") // Does not work
I can't find any hint how to the division. The result should be 13.7ephemient
09/26/2021, 12:29 AMvalue.toLong().toBigDecimal().scaleByPowerOfTen(-1)
but there is no kotlin-stdlib functionalityephemient
09/26/2021, 12:32 AMvalue.toDouble() / 10.0
should format to more-or-less the sameLilly
09/26/2021, 1:18 AMvalue.toDouble() / 10.0
Good point, thanks!CLOVIS
09/26/2021, 7:38 AMephemient
09/27/2021, 4:03 AM(UInt.MAX_VALUE.toDouble() / 10.0).ulp ≈ 2.9802322387695312E-8
(2^-25) so there is definitely enough precision for one decimal pointephemient
09/27/2021, 4:08 AMephemient
09/27/2021, 4:09 AM429496729.5.toString()
will be in scientific notation by default (on JVM), and there's no platform-independent way to control numeric formatting in Kotlin