Price conversions break when using a non-US number format #2

Open
opened 2025-03-31 14:14:22 +00:00 by tyiu · 1 comment
tyiu commented 2025-03-31 14:14:22 +00:00 (Migrated from github.com)
No description provided.
tyiu commented 2025-04-17 13:10:03 +00:00 (Migrated from github.com)

The issue appears to be that calls to Decimal(string:) do not respect the current locale's number formatting, so a number like 123,45 in a German regional locale has the ,45 decimals dropped. Here is an example, but all call sites that use this method need to be fixed:
482e50b6ba/Sources/SatsPrice/SatsViewModel.swift (L351)

The issue appears to be that calls to `Decimal(string:)` do not respect the current locale's number formatting, so a number like `123,45` in a German regional locale has the `,45` decimals dropped. Here is an example, but all call sites that use this method need to be fixed: https://github.com/tyiu/sats-price/blob/482e50b6bae166e342e88fe039af260d5dfd89c3/Sources/SatsPrice/SatsViewModel.swift#L351
Sign in to join this conversation.