hnhdigital-os / laravel-number-converter
Number to word, roman, ordinal converter
Installs: 119 474
Dependents: 2
Suggesters: 0
Security: 0
Stars: 19
Watchers: 4
Forks: 7
Open Issues: 1
Requires
- php: ^7.2|^8.0
- hnhdigital-os/php-number-converter: 1.*
- illuminate/support: ^5.8|^6.0|^7.0|^8.0|^9.0|^10.0
Requires (Dev)
- phpmd/phpmd: ~2.0
- squizlabs/php_codesniffer: ~3.0
README
This package provides a Laravel wrapper to the PHP-Number-Converter package that provides the ability to convert a numerical number to a word, roman numeral, or an ordinal suffix.
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.
Requirements
- PHP ^7.2|^8.0
- Laravel ^5.8|^6.0|^7.0|^8.0|^9.0|^10.0
Install
Via composer:
$ composer require hnhdigital-os/laravel-number-converter
Enable an alias by editing config/app.php:
'aliases' => [ ... 'NumConvert' => 'HnhDigital\LaravelNumberConverter\Facade', ... ]
Convert to word
Supported number range -2147483647 to 2147483647.
echo NumConvert::word(1); echo number_to_word(1);
one
Convert to roman
Supported number range 1 to 3999.
echo NumConvert::roman(1); echo number_to_roman(1);
I
Ordinal (word + suffix)
Supported number range 1 to 2147483647.
echo NumConvert::wordOrdinal(1); echo number_to_word_ordinal(1);
first
Ordinal (number + suffix)
Supported number range 1 to 2147483647.
echo NumConvert::numberOrdinal(1); echo number_with_ordinal_suffix(1);
1st
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.