hey :slightly_smiling_face: i am working on a kotl...
# javascript
c
hey 🙂 i am working on a kotlin multplatform library that supports jvm and js(node). my complete code is common code. when i convert floats without decimals to string it behaves different on jvm and js.
Copy code
@Test
fun `float conversion to string`() {
  // succeeds on node JS - fails on JVM
  assertEquals(25f.toString(), "25")
  // succeeds on JVM - fails on node JS
  assertEquals(25f.toString(), "25.0")
}
how can i make sure it behaves consistent? or at least make my tests work against jvm and js?
j
c
Please don’t cross-post, information is lost if the same post is spread on multiple channels.
👍 1
j
Workaround is just to do sting templating as the expected value for now
l
Is there a multiplatform string formatter library available that one could leverage?