currency_formatter
2.3.0, released a year ago by roman910.tk
Format and parse monetary values with customizable currency symbols and separators.
WASM-ready
What it does
Provides a CurrencyFormat class to define formatting rules and CurrencyFormatter to format and parse numbers. Supports predefined major currencies, locale-based defaults, and custom currencies.
AI-written summary of version 2.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display money values in a specific currency format.
- You want to parse formatted money strings back to numbers.
- You need locale-aware currency formatting without Flutter dependencies.
Skip it when
- You require complex internationalization beyond simple formatting.
- You need a full-featured localization framework with translations.
- You are building a UI widget library that needs theming or state management.
Strengths
- Pure Dart, no Flutter dependency.
- Supports custom symbols, separators, and negative sign placement.
- Includes predefined major currencies and locale-based defaults.
- Compact API for formatting and parsing.
Weaknesses
- Limited to numeric formatting, not full localization.
- No built-in UI widgets for input or display.
- No support for currency conversion or rates.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
```dart
import 'package:currency_formatter/currency_formatter.dart';
final euro = CurrencyFormat(
code: 'eur',
symbol: '€',
symbolSide: SymbolSide.left,
thousandSeparator: '.',
decimalSeparator: ',',
);
final formatted = CurrencyFormatter.format(1910.9347, euro); // '1.910,93 €'
final parsed = CurrencyFormatter.parse(formatted, euro); // 1910.93
```Alternatives
Packages that do the same job and could replace currency_formatter.
Works with
Packages commonly used together with currency_formatter: ones it builds on, ones built on it, and its own family.