Is there any multiplatform support coming in the near future to support Money/Currency? I have a POS app that has a lot of money calculations and would love to share the logic between Android and iOS but can’t find an option (production ready) at this time.
1 Like
For this particular purpose I would go with an inline class (with Int or Long as storage) that represents a fixed point. Basically do your calculations in cents (or pennies etc.) to not have to deal with floating point issues. You could have the inline class hide the challenges related to this (or just provide a nicer toString
). Of course this assumes that you merely care about the amount in a specific currency. Multi-currency would require you to actually attach a currency to your amounts and do all kinds of additional checks to ensure correctness (1Eur + 1GBP + 1USD = invalid).