Skip to content

v0.2.0 - Native currency & percent formatting

Choose a tag to compare

@AmatoGiulio AmatoGiulio released this 17 Aug 10:22
· 26 commits to main since this release

What's new

v0.2.0 expands NumericText beyond plain numbers with native, locale-aware currency and percent formatting while keeping formatting part of the transition itself.

Formatting

  • New format prop shaped as a subset of Intl.NumberFormatOptions
  • Native currency formatting on iOS and Android
  • Native percent formatting
  • currency shorthand
  • currencyDisplay: 'symbol' | 'code'
  • Accounting-style negative currency values
  • Configurable grouping, integer padding, fraction digits, and significant digits
  • Consistent half-away-from-zero rounding across iOS, Android, and web
  • Format-only changes can animate even when the numeric value stays the same

Android transition work

Currency symbols, ISO codes, percent signs, accounting brackets, and locale-specific affixes now participate structurally in the transition instead of being treated as static text.

This release also includes fixes for:

  • bidi / RTL currency layouts
  • rapid format retargeting and reversals
  • repeated same-glyph sign transitions
  • outgoing glyph clipping during shrinking format changes
  • structural affix identity across grouping changes

The existing first-release motion constants were not retuned.

Accessibility

Standard React Native accessibility props are now forwarded through NumericText, while Android preserves the formatted value as the default accessibility description without overriding an explicit accessibilityLabel.

Validation

The formatting transition work was validated against the SwiftUI .numericText() ground truth using a deterministic 29-step currency/format sequence covering USD, EUR, PAB, AED RTL, accounting, percent, JPY, and BHD.

The release gate also passes library, web, Android and iOS builds, lint, typecheck, and unit tests.

Credits

Currency and percent formatting originated from a contribution by @Amanfromearth in #4.

The original API direction was retained and then validated and extended against the SwiftUI ground truth before landing in the final implementation.

currencyDisplay: 'name' and trailingDecimalSeparator remain intentionally deferred for a future release.

Full diff: v0.1.0...v0.2.0