I have an application developed for iOS and Android natively. We have a monetary calculation that we intend to refactor by unifying it in KMM. My question is: How do you handle monetary values in KMM, considering that BigDecimal is not compatible? Thinking about a large project, I cannot use third-party libraries with low engagement.
d
dorche
01/24/2024, 1:04 AM
We just have our own expect/actual class wrappers around BigDecimal and NSDecimalNumber
j
Jan Holešovský
01/24/2024, 8:14 AM
@Ewerton Pontinihttps://github.com/kendy/Kotlin-Native-BigDecimal is a drop-in replacement for java.math.BigDecimal for KMM on iOS. I've ported it from Android to iOS and it is production-ready - I use it in an app where it undergoes over 2000 unit tests.