I'm looking for some feedback: I'm working on a l...
# multiplatform
b
I'm looking for some feedback: I'm working on a library that includes Currency and allows you to find the currency information by currency code. I'm trying to support all the main platforms. In some platforms, like Android and the JVM, and iOS i can look up the currency from the native platform, They contain most of the information (although iOS is a pain) other platforms like JS, WasmJs, Linux, there is no standard currency built in. So in order to support those platforms we had to collect the resources from official sources, the same way its done in JS. The problem is that the different platforms do not all have consistent data. e.g. the symbol returned for a particular code may not be the same across the native platforms. Or the name of the currency may not be the same. Our data source is ISO-4217: https://www.iso.org/iso-4217-currency-codes.html In the future we'll use this to for formatting currency values. So, we have two choices: 1. Allow the discrepancy on each platform, and live with it (tests are a pain, but we can sort that out) 2. Use the KMP resources we have put together and make the currency consistent across all platforms. So, I wanted to get some feedback on what people think is more important, using the platform native currency information, or making it consistent for all KMP platforms. In the end we'll make a decision based on how we are using it, but I'd like to make this useful for more than just us, which means I'm looking for arguments for and against the inconsistent native implementations. So far, I'm leaning toward making it consistent so you'll know what you are getting, and it'll make testing and maintenance easier, but I'm sure we have not considered all angles. The project is here in case anyone wants to take a look: https://github.com/aughtone/aughtone-types
p
Hey Brill, tricky question, but I would say making things consistent across platforms. It will make the library easier to use and not too edge-casey for different platforms
👍 1
☝🏼 1
t
I agree, consistency across platforms is best as you want as close to the same experience on each platform with the UI styling somewhat in that platform's user behavior. I would find a way to standardize in the format your users find the most useful and go from there.
b
It won't be hard to use the same data for everyone, in fact it will be easier to not have to manage the expect/actual.
👍🏼 1