You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: fiat amount reads as zero with arabic-indic digits #1965
On a device whose locale uses Arabic-Indic digits (for example Arabic), a fiat amount that the app writes into the amount keypad stops parsing after an edit: the screen still shows a nonzero amount, but the amount becomes zero and Continue is disabled.
Steps
Set the device language to Arabic (Arabic-Indic digits).
Open an amount screen with the number pad (send, or transfer to spending) and show the amount in fiat.
Tap 25% or Max (or switch the unit while an amount is entered), then tap delete once.
Expected: the amount shrinks by one digit and stays valid.
Observed: the amount shows digits but is treated as zero; Continue is disabled.
Cause
AmountInputViewModel.setSats and switchUnit load formatDisplayTextFromAmount's text into the keypad's raw input. For fiat that text comes from BigDecimal.formatCurrency (models/Currency.kt), whose DecimalFormatSymbols(Locale.getDefault()) keeps the locale's zero digit, so the raw input holds Arabic-Indic digits. convertFiatToSats then fails toDoubleOrNull() on it. Typed digits are ASCII, so only amounts the app writes are affected.
Fix direction
Keep the keypad's raw input in ASCII digits regardless of how the amount is displayed (format the raw input with Locale.US digits, or build it from the sats value directly).
Activity