Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/jifalops/locales
- Owner: jifalops
- License: mit
- Created: 2018-09-22T18:15:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T23:10:23.000Z (about 4 years ago)
- Last Synced: 2023-07-27T19:20:55.961Z (over 1 year ago)
- Language: Dart
- Size: 33.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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
}
```