localizedGroupedInteger() routed the digit string through
NSDecimalNumber before formatting, which has a ~38-significant-digit
precision ceiling — past that, it silently replaced the excess
trailing digits with zeros. Since every field re-groups on each edit,
a Sats amount typed past ~38 digits kept re-corrupting through this on
every keystroke, visibly changing without the user typing anything new.
Groups the digit string directly instead, using only the locale's
grouping metadata (separator + primary/secondary group sizes) — pure
string manipulation with no numeric precision limit. Verified against
NSNumberFormatter's own output across multiple locales (including
hi-IN's irregular "12,34,567" grouping) and added a regression test
for a 60-digit input.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy