-
Notifications
You must be signed in to change notification settings - Fork 2
fix: place currency symbol correctly based on locale convention #771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Some currencies like PLN, EUR, CZK display their symbol after the amount (e.g., "0.35zł" not "zł0.35"), while others like USD, GBP display it before. This adds formattedWithSymbol() to ConvertedAmount which formats amounts with proper symbol placement based on the currency code.
788b741 to
46057d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review findings
|
@piotr-iohk usually the Swift and Kotlin coding languages have built-in APIs for locale-based number formatting (and currency specific variants). Did you already try to inquire with your AI agent if using those is not feasible here?! You normally should get the "perfect" placement of currency symbol for all locales. |
Guess the same thing here: synonymdev/bitkit-ios#434 (comment) |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Fixes #733
This PR fixes currency symbol placement for currencies that display the symbol after the amount (PLN, CZK, SEK, CHF, NOK, DKK, HUF, and others).
Description
SUFFIX_SYMBOL_CURRENCIESset inCurrency.ktas single source of truth for currencies whose symbol goes after the amountisSymbolSuffixproperty andformattedWithSymbol()method toConvertedAmountBalanceHeaderView,MoneyText,NumberPadTextField,WalletBalanceView,ActivityRowNotifyPaymentReceivedHandler,ReceiveConfirmScreen, andSendCoinSelectionScreenwithformattedWithSymbol()Adding a new suffix currency only requires adding it to the
SUFFIX_SYMBOL_CURRENCIESset — all UI components derive behavior from it.Preview
Screen.Recording.2026-02-09.at.14.08.04.mov
QA Notes
1. Suffix currency — home screen balance
2. Suffix currency — send/receive amount input
3. Suffix currency — activity list
4. Suffix currency — notifications
5. Prefix currency — regression
6. Hidden balance