quick sanity check about formatting kmp resources....
# multiplatform
j
quick sanity check about formatting kmp resources.... ai is telling me "The safest approach in KMP is to pre-format the double yourself and pass it as a
String
using `%1$s`:" and .
%f
with doubles can be unreliable across platforms in KMP, is that acccurate?
e
but there isn't a multiplatform to preformat them yourself either, https://youtrack.jetbrains.com/issue/KT-21644
j
ai told me to preformat them as a string in kotlin like :
Copy code
"%.2f".format(myfloat)
e
good luck with that. it's only on JVM
don't trust AI
😀 3
j
lol don't trust AI-> thats why i asked here before ripping all the instances out, so then what should i do?
d
@Jeremie D please add a thumbs-up on the above issue! 😛
j
yeah... this is annoying for converting existing apps to kmp but shouldnt affect fresh projects, is that why its not being addressed yet? seems not that big of a task but then again i have no idea what im talking about here so.
d
I think the main difficulty, as for all multiplatform stuff, is to ensure the implementation is consistent on all platforms. Then again I don't really understand either why this has not been addressed before.
m