meezaan/arabic-numbers

There is no license information available for the latest version (1.0) of this package.

Library to convert Latin numbers to Arabic and vice versa

1.0 2017-07-23 16:09 UTC

This package is auto-updated.

Last update: 2024-11-27 14:13:24 UTC


README

CircleCI

بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ

Arabic Numbers

This library helps convert between latin and arabic numerals and vice versa.

Installation

To install:

composer require meezaan/arabic-numbers

Usage

To use the library in your apps, make sure the composer autoload file is already included. Then:

use ArabicNumbers\Numbers;

// Latin to Arabic
$arabic = Numbers::latinToArabic(157); // returns ١٥٧

// Arabic to latin
$latin - Numbers::arabicToLatin(١٥٧); // returns 157

// Arabic to HTML
$html = Numbers::ArabicToHtml(١٥٧); // returns ١٥٧

Unit Tests

These are included in the tests folder. To run them, make sure you've already run composer install. Then:

php vendor/bin/phpunit --bootstrap vendor/autoload.php tests/

Happy days.