Hello, How to convert a normal double in Kotlin t...
# multiplatform
d
Hello, How to convert a normal double in Kotlin to Swiftui? I have this double in kotlin with 7 decimals: 47.6364658. But the swift will convert automatically to 47.636466 (only 6 decimals) How can I convert this?
j
In Swift REPL I am able to create a double with 7 decimals. It seems like Kotlin is the one responsible for this erroneous conversion. To avoid any conversion issues, you could try to multiply your double by
10^7
, convert it to a Kotlin Int, then make the conversion to a Swift Int, and finally divide it by
10^7
.