Skip to content

Conversation

@BohdanStarunskyi
Copy link

@BohdanStarunskyi BohdanStarunskyi commented Aug 9, 2025

Add comprehensive currency formatting support

Added feature for #133

Currency Support

  • 50+ currencies including all major world currencies
  • Regional coverage: Asia, Middle East, Africa, Latin America, Eastern Europe
  • Cryptocurrency support: Bitcoin (BTC), Ethereum (ETH)
  • Precious metals: Gold (XAU), Silver (XAG)
  • Case-insensitive currency code handling

Number Formatting

  • Indian numbering system: 12,34,567 format support
  • Western numbering system: 1,234,567 format support
  • No grouping option for specialized use cases
  • Currency-specific decimals:
    • JPY: 0 decimal places
    • BTC: 8 decimal places
    • Standard currencies: 2 decimal places

Type Support

  • All Go numeric types: int8, int16, int32, uint, uint64, etc.
  • Big number support: *big.Float, *big.Int
  • String number parsing for very large values
  • Enhanced error handling for invalid inputs

Usage Examples

Basic Usage

Currency(1234567.89, "USD")  // "$ 1,234,567.89"
Currency(1000000, "JPY")     // "¥ 1,000,000" (no decimals)
Currency(-500000, "EUR")     // "€ -500,000.00"

Advanced Features

CurrencyWithName(25000, "CAD")  // "C$ 25,000.00 (Canadian Dollar)"
IsSupported("USD")              // true
SupportedCurrencies()           // ["USD", "EUR", "GBP", ...]

@BohdanStarunskyi BohdanStarunskyi changed the title Add currency formatting support(fixes #133) Add currency formatting support (fixes #133) Aug 9, 2025
@BohdanStarunskyi BohdanStarunskyi changed the title Add currency formatting support (fixes #133) feat: add currency formatting support (issue #133) Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant