tafkeet 1.2.3 copy "tafkeet: ^1.2.3" to clipboard
tafkeet: ^1.2.3 copied to clipboard

Convert numbers to words in Arabic and English with 90+ currency support. Includes extensions for double, int, and String types.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.2.3 - 2025-12-17 #

๐Ÿ› Bug Fixes #

Arabic Number Conversion - Thousands and Millions

  • Fixed incorrect conversion of numbers 1000, 2000, and their derivatives

    • 1000 now converts to "ุฃู„ู" instead of "ูˆุงุญุฏ ุฃู„ู" โœ…
    • 1500 now converts to "ุฃู„ู ูˆุฎู…ุณู…ุงุฆุฉ" instead of "ูˆุงุญุฏ ุฃู„ู ูˆุฎู…ุณู…ุงุฆุฉ" โœ…
    • 1001 now converts to "ุฃู„ู ูˆูˆุงุญุฏ" instead of "ูˆุงุญุฏ ุฃู„ู ูˆูˆุงุญุฏ" โœ…
    • 2000 now converts to "ุฃู„ูุงู†" instead of "ุงุซู†ุงู† ุฃู„ู" โœ…
    • 2500 now converts to "ุฃู„ูุงู† ูˆุฎู…ุณู…ุงุฆุฉ" instead of "ุงุซู†ุงู† ุฃู„ู ูˆุฎู…ุณู…ุงุฆุฉ" โœ…
    • 1000000 now converts to "ู…ู„ูŠูˆู†" instead of "ูˆุงุญุฏ ู…ู„ูŠูˆู†" โœ…
    • 2000000 now converts to "ู…ู„ูŠูˆู†ุงู†" instead of "ุงุซู†ุงู† ู…ู„ูŠูˆู†" โœ…
  • Root Cause: The converter was adding the word "ูˆุงุญุฏ" (one) or "ุงุซู†ุงู†" (two) before group names (thousands, millions, etc.) which is grammatically incorrect in Arabic

  • Solution: Special handling for values 1 and 2 in non-last groups to use only the group name or dual form

๐Ÿงช Testing #

  • Added 10+ comprehensive test cases covering:
    • Thousands: 1000, 1500, 1001, 2000, 2500, 3000
    • Millions: 1000000, 2000000, 3000000
    • Complex cases: 1001000, 2002000

1.2.2 - 2025-12-09 #

๐Ÿ”„ Changed #

  • No changes in this version

1.2.1 - 2025-12-09 #

๐Ÿ”„ Changed #

  • Default Prefix and Suffix: Changed default values for prefix and suffix parameters to empty strings ('') instead of 'ูู‚ุท ู„ุง ุบูŠุฑ' (Arabic) and 'only' (English)
    • This gives users full control over prefix and suffix text
    • Users can now add custom prefix/suffix only when needed
    • All examples in README updated to reflect this change

๐Ÿ“š Documentation #

  • Updated all examples in README.md to show empty default prefix/suffix
  • Added clarification that prefix and suffix are empty by default
  • Updated example outputs to remove default suffix text

1.2.0 - 2025-12-09 #

โœจ New Features #

Arabic-Indic Numerals Support

  • Automatic Conversion: String extension now automatically converts Arabic-Indic digits (ู ูกูขูฃูคูฅูฆูงูจูฉ) to Western digits
  • replaceArabicNumber(): New static method in NumberUtils to convert Arabic numerals to English
  • replaceArabicNumbers(): New extension on String for easy numeral conversion
  • Works seamlessly with tafkeet() - Arabic numerals are automatically handled
'ูกูขูฃ'.tafkeet(lang: Lang.ar); // Automatically converts and processes
'ูฅู ู '.replaceArabicNumbers(); // Returns: '500'
NumberUtils.replaceArabicNumber('ุงู„ุณุนุฑ: ูฉูฉูฉ'); // Returns: 'ุงู„ุณุนุฑ: 999'

Number Formatting

  • amountFormat(): New method to format numbers with thousand separators (commas)
  • Extensions on all numeric types: Available on double, int, and String
  • Decimal Precision Control: Use digit parameter to control decimal places
  • Arabic Numerals Support: Works with both Western and Arabic-Indic digits
  • Smart Validation: Returns original string if input is not a valid number
// Format with thousand separators
1234567.amountFormat(); // Returns: '1,234,567'
1234567.89.amountFormat(digit: 2); // Returns: '1,234,567.89'

// Works with strings and Arabic numerals
'ูกูขูฃูคูฅูฆูง'.amountFormat(); // Returns: '1,234,567'
'1234567.89'.amountFormat(digit: 2); // Returns: '1,234,567.89'

// Combine with tafkeet
final amount = 1234567.89;
print(amount.amountFormat(digit: 2)); // 1,234,567.89
print(amount.tafkeet(lang: Lang.ar, currency: Currency.SAR));

๐Ÿ“š Documentation #

  • Added comprehensive documentation for Arabic-Indic numerals support in README
  • Added "Number Formatting" section with examples
  • Updated all examples to showcase new features
  • Added 7 new examples in example/main.dart (Examples 24-30)

๐Ÿงช Testing #

  • Added 11 new unit tests for amountFormat() functionality
  • Added 8 new unit tests for Arabic numerals conversion
  • Total test count: 32 tests (all passing โœ…)

๐Ÿ“ฆ Package Updates #

  • Updated package description
  • Package size: 21 KB (compressed)
  • All code comments and documentation in English

1.0.0 - 2025-12-09 #

๐ŸŽ‰ Initial Release #

First stable release of Tafkeet - A comprehensive Flutter package for converting numbers to words in Arabic and English.

โœจ Features #

Core Functionality

  • Number to Words Conversion: Convert numbers to words in Arabic and English
  • Dual Language Support: Full support for Arabic (Lang.ar) and English (Lang.en)
  • Large Number Support: Handle numbers up to trillions
  • Decimal Support: Convert decimal numbers with automatic rounding based on currency precision (partPrecision)
  • Gender-Aware: Correct masculine/feminine handling based on currency type

Currency Support

  • 90+ World Currencies: Support for over 90 currencies from around the world
  • 21 Arabic Currencies: SAR, AED, KWD, QAR, OMR, BHD, EGP, SYP, JOD, LBP, IQD, YER, LYD, TND, DZD, MAD, SDG, SOS, MRU, DJF, KMF
  • Major World Currencies: USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD, CNY, INR, RUB, BRL, ZAR, SEK, NOK, DKK, PLN, TRY, and more
  • Custom Currency Support: Add, update, or remove custom currencies
  • Currency Groups: Currency.arabicCurrencies and Currency.majorCurrencies getters

API & Extensions

  • Simple API: Tafkeet.convert(number, lang: Lang.ar, currency: Currency.SAR)
  • Type Extensions: Convert numbers directly with .tafkeet() method
    • double extension: 120.5.tafkeet(lang: Lang.ar)
    • int extension: 250.tafkeet(lang: Lang.en)
    • String extension: '75.25'.tafkeet() with automatic number validation
    • Arabic-Indic Numerals Support: Automatically converts Arabic numerals (ู ูกูขูฃูคูฅูฆูงูจูฉ) in String extension
  • Arabic Numerals Replacement:
    • NumberUtils.replaceArabicNumber() - Convert Arabic-Indic digits to Western digits
    • String.replaceArabicNumbers() extension - Convert numerals directly on strings
  • Number Formatting:
    • NumberUtils.amountFormat() - Format numbers with thousand separators (commas)
    • .amountFormat() extension on double, int, and String - Format numbers directly
    • Supports decimal precision control with digit parameter
    • Works with Arabic-Indic numerals
  • Configuration: Tafkeet.configure() for setting default language and currency
  • Custom Prefix/Suffix: Add custom text before and after converted numbers

Currency Management

  • CurrencyConfig.addCurrency() - Add custom currencies
  • CurrencyConfig.updateCurrency() - Update existing currency settings
  • CurrencyConfig.removeCurrency() - Remove currencies
  • CurrencyConfig.getCurrency() - Get currency information
  • CurrencyConfig.hasCurrency() - Check if currency exists
  • CurrencyConfig.getAllCurrencies() - Get all available currencies
  • CurrencyConfig.reset() - Reset to default configuration

Developer Experience

  • Well-Organized Structure: Clean folder structure with separate modules
  • Comprehensive Documentation: Full English documentation with examples
  • Type Safety: Strong typing with enums for languages and currencies
  • Extensible: Easy to add new languages or currencies
  • Tested: Full test coverage with 13+ unit tests

๐Ÿ“ฆ Package Structure #

lib/
โ”œโ”€โ”€ tafkeet.dart                 # Main entry point
โ”œโ”€โ”€ tafkeet/
โ”‚   โ”œโ”€โ”€ tafkeet.dart            # Core conversion class
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ language.dart       # Language enum (Lang.ar, Lang.en)
โ”‚   โ”‚   โ”œโ”€โ”€ currency.dart       # Currency enum (90+ currencies)
โ”‚   โ”‚   โ””โ”€โ”€ currency_info.dart  # Currency information model
โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ””โ”€โ”€ currency_config.dart # Currency configuration manager
โ”‚   โ”œโ”€โ”€ converters/
โ”‚   โ”‚   โ”œโ”€โ”€ arabic_converter.dart  # Arabic number conversion logic
โ”‚   โ”‚   โ””โ”€โ”€ english_converter.dart # English number conversion logic
โ”‚   โ”œโ”€โ”€ extensions/
โ”‚   โ”‚   โ”œโ”€โ”€ double_extension.dart  # Extension on double
โ”‚   โ”‚   โ”œโ”€โ”€ int_extension.dart     # Extension on int
โ”‚   โ”‚   โ””โ”€โ”€ string_extension.dart  # Extension on String
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ””โ”€โ”€ number_utils.dart      # Number utility functions

๐Ÿ”ง Technical Details #

  • Minimum SDK: Dart 3.0.0
  • Flutter: 1.17.0 or higher
  • License: MIT
  • Code Quality: All code comments in English
  • Documentation: Complete README.md with usage examples

๐Ÿ“ Examples #

// Basic conversion
Tafkeet.convert(120, lang: Lang.ar);

// With currency
Tafkeet.convert(250.50, lang: Lang.ar, currency: Currency.SAR);

// Using extensions
120.tafkeet(lang: Lang.ar);
'75.25'.tafkeet(currency: Currency.USD);

// Arabic-Indic numerals support
'ูกูขูฃ'.tafkeet(lang: Lang.ar); // Automatically converts ูกูขูฃ to 123
'ูฅู ู '.replaceArabicNumbers(); // Returns: '500'

// Number formatting with thousand separators
1234567.amountFormat(); // Returns: '1,234,567'
1234567.89.amountFormat(digit: 2); // Returns: '1,234,567.89'
'ูกูขูฃูคูฅูฆูง'.amountFormat(); // Returns: '1,234,567'

// Configure defaults
Tafkeet.configure(defaultLang: Lang.ar, defaultCurrency: Currency.SAR);

// Decimal rounding (automatic based on partPrecision)
Tafkeet.convert(19002.989, lang: Lang.ar, currency: Currency.SAR);
// 19002.989 โ†’ rounded to 19002.99 (2 decimal places)
// Result: ุชุณุนุฉ ุนุดุฑ ุฃู„ู ูˆ ุงุซู†ุงู† ุฑูŠุงู„ ุณุนูˆุฏูŠ ูˆ ุชุณุนุฉ ูˆ ุชุณุนูˆู† ู‡ู„ู„ุฉ

๐ŸŒ Supported Languages #

  • Arabic (ar) - ุงู„ุนุฑุจูŠุฉ
  • English (en)

๐Ÿ’ฐ Currency Support #

  • Total: 91 currencies
  • Arabic: 21 currencies
  • Major: 10+ major world currencies
  • Custom: Unlimited custom currencies via configuration

Future Plans #

  • Add more languages (French, Spanish, etc.)
  • Add more currency configurations
  • Improve performance for very large numbers
  • Add more customization options
1
likes
160
points
134
downloads

Publisher

verified publishertusaway.com

Weekly Downloads

Convert numbers to words in Arabic and English with 90+ currency support. Includes extensions for double, int, and String types.

Repository (GitHub)
View/report issues

Topics

#numbers #arabic #localization #i18n #currency

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on tafkeet