amount_to_word 2.5.2 copy "amount_to_word: ^2.5.2" to clipboard
amount_to_word: ^2.5.2 copied to clipboard

Number & amount to words for Flutter/Dart — Persian, English, Turkish, Arabic, Spanish, Hindi with 23 currencies, ordinals, invoices & BigInt.

example/example.dart

import 'package:amount_to_word/amount_to_word.dart';

/// Showcase entry point for pub.flutter-io.cn — run: `dart run example/example.dart`
void main() {
  final en = AmountToWords(Language.en);
  final fa = AmountToWords(Language.fa);
  final tr = AmountToWords(Language.tr);
  final ar = AmountToWords(Language.ar);
  final es = AmountToWords(Language.es);
  final hi = AmountToWords(Language.hi);

  // Numbers to words
  print(en.toWords(12345));
  print(fa.toWords(12345));
  print(tr.toWords(12345));
  print(ar.toWords(12345));
  print(es.toWords(12345));
  print(hi.toWords(12345));

  // Amounts with currency
  print(en.convert(123.45, currency: CurrencyConfig.usDollar));
  print(fa.convert(1000, currency: CurrencyConfig.iranianToman));
  print(hi.convert(1250.5, currency: CurrencyConfig.indianRupee));

  // Extensions / ordinals / invoice
  print(99.toWords(language: Language.es));
  print(1.toOrdinal(language: Language.en));
  print(
    50.toCurrency(
      currency: CurrencyConfig.euro,
      only: true,
      language: Language.en,
    ),
  );

  // Mixed + Indian + BigInt
  print(en.toMixed(1500000));
  print(
    en.toWords(1500000, numberingSystem: NumberingSystem.indian),
  );
  print(BigInt.from(1000000000000).toWords());
}
3
likes
160
points
110
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Number & amount to words for Flutter/Dart — Persian, English, Turkish, Arabic, Spanish, Hindi with 23 currencies, ordinals, invoices & BigInt.

Repository (GitHub)
View/report issues

Topics

#number-to-words #currency #flutter #i18n #invoice

License

MIT (license)

Dependencies

flutter

More

Packages that depend on amount_to_word