2.1โœ“ STABLEโ†“ 0 downloads0 files ยท 0 B
Avatar of Tayeb-Aliby Tayeb-Alipublished
$ gh release view 2.1 --repo thesmarter/Tafqeet

Quick install

$ gh release download 2.1 --repo thesmarter/Tafqeet

Downloads

$ NO_ATTACHED_BINARIES โ€” grab the source archive below.

SOURCE_CODE //

โ†“ .tar.gzโ†“ .zip

Release notes

๐ŸŽ‰ What's New in v2.1

#### ๐Ÿ’ฑ New: Expanded Currency Support Added 16 new currencies bringing total support to 19 currencies:

Arab Currencies / ุงู„ุนู…ู„ุงุช ุงู„ุนุฑุจูŠุฉ:

CodeCurrency
egpEgyptian Pound (ุฌู†ูŠู‡ ู…ุตุฑูŠ)
sypSyrian Pound (ุฌู†ูŠู‡ ุณูˆุฑูŠ)
lbpLebanese Pound (ุฌู†ูŠู‡ ู„ุจู†ุงู†ูŠ)
iqdIraqi Dinar (ุฏูŠู†ุงุฑ ุนุฑุงู‚ูŠ)
jodJordanian Dinar (ุฏูŠู†ุงุฑ ุฃุฑุฏู†ูŠ)
omrOmani Rial (ุฑูŠุงู„ ุนู…ุงู†ูŠ)
qarQatari Rial (ุฑูŠุงู„ ู‚ุทุฑูŠ)
aedUAE Dirham (ุฏุฑู‡ู… ุฅู…ุงุฑุงุชูŠ)
kwdKuwaiti Dinar (ุฏูŠู†ุงุฑ ูƒูˆูŠุชูŠ)
bhdBahraini Dinar (ุฏูŠู†ุงุฑ ุจุญุฑูŠู†ูŠ)

Western Currencies / ุงู„ุนู…ู„ุงุช ุงู„ุบุฑุจูŠุฉ:

CodeCurrency
eurEuro (ูŠูˆุฑูˆ)
gbpBritish Pound (ุฌู†ูŠู‡ ุฅุณุชุฑู„ูŠู†ูŠ)
cadCanadian Dollar (ุฏูˆู„ุงุฑ ูƒู†ุฏูŠ)
audAustralian Dollar (ุฏูˆู„ุงุฑ ุฃุณุชุฑุงู„ูŠ)
jpyJapanese Yen (ูŠู† ูŠุงุจุงู†ูŠ)
chfSwiss Franc (ูุฑู†ูƒ ุณูˆูŠุณุฑูŠ)

#### ๐Ÿ› Bug Fixes

  • Fixed SDG currency main name: ู‚ุฑุด โ†’ ุฌู†ูŠู‡ (was incorrectly set to piastre instead of pound)
  • Fixed empty fractional currency handling (e.g., JPY has no sub-unit) - no longer appends empty words

#### ๐Ÿ“– Documentation

  • Updated README with comprehensive currency tables grouped by Arab and Western
  • Added bilingual currency tables in both English and Arabic READMEs

๐Ÿ“‹ Full Change List

  • Modified: src/Core/Tafqeet.php - Expanded CURRENCIES constant (3 โ†’ 19 currencies)
  • Modified: src/Core/Tafqeet.php - Handle empty fractional units gracefully
  • Modified: README.md - Updated currency tables
  • Modified: README-ar.md - Updated currency tables
  • Added: 13 new currency test cases

๐Ÿ’ก Usage Examples

PHP

// Egyptian Pound
Tafqeet::arablic(1000.50, 'egp');
// Output: ูู‚ุท ุฃู„ู ุฌู†ูŠู‡ ูˆุฎู…ุณูˆู† ู‚ุฑุด ู„ุงุบูŠุฑ

// UAE Dirham
Tafqeet::arablic(500, 'aed');
// Output: ูู‚ุท ุฎู…ุณูˆู† ุฏุฑู‡ู…ู‹ุง ู„ุงุบูŠุฑ

// Euro
Tafqeet::arablic(250.75, 'eur');
// Output: ูู‚ุท ู…ุงุฆุฉ ูˆุฎู…ุณูˆู† ูŠูˆุฑูˆู‹ุง ูˆุณุจุนุฉ ูˆุณุจุนูˆู† ุณู†ุช ู„ุงุบูŠุฑ

// British Pound
Tafqeet::arablic(100, 'gbp');
// Output: ูู‚ุท ู…ุงุฆุฉ ุฌู†ูŠู‡ ุฅุณุชุฑู„ูŠู†ูŠู‹ุง ู„ุงุบูŠุฑ

// Japanese Yen (no fractional)
Tafqeet::arablic(1000, 'jpy');
// Output: ูู‚ุท ุฃู„ู ูŠู† ู„ุงุบูŠุฑ

๐Ÿ”ง Technical Details

  • Currencies stored as associative array with: main1, main2, single, multi
  • Empty single/multi values are skipped in output (e.g., JPY)
  • All 17 PHPUnit tests passing โœ…
  • PSR-12 compliant โœ…

Full Changelog: https://github.com/thesmarter/Tafqeet/compare/v2.0...2.1