Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jifalops/locales

Locale codes and ISO 4217 currency codes.
https://github.com/jifalops/locales

Last synced: 2 months ago
JSON representation

Locale codes and ISO 4217 currency codes.

Awesome Lists containing this project

README

        

# locales
Locale codes strings ("en_US") and ISO 4217 currency codes ("USD").

## Example

```dart
import 'package:locales/locales.dart';
import 'package:locales/currency_codes.dart';
import 'package:intl/intl.dart';

void main() {
final locale = Locale.en_US;
final currencyCode = CurrencyCode.usd;
final format = NumberFormat.simpleCurrency(
locale: '$locale', name: '$currencyCode', decimalDigits: 2);
print(locale); // en_US
print(currencyCode); // USD
print(format.format(123.456)); // $123.46
}
```