oliversarfas / number-to-words
Laravel Wrapper for kwn/number-to-words
Installs: 5 418
Dependents: 0
Suggesters: 0
Security: 0
Stars: 35
Watchers: 4
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- brianium/paratest: ^0.4.3
- phpunit/phpunit: ^8.5.33
README
PHP 8.x and Laravel Wrapper for kwn/number-to-words
Installation
You can install the package via composer:
composer require cleveregg-digital/number-to-words
Usage
To convert your number to words, simply call the static function on the NumberToWords
facade.
\NumberToWords::toWords(5120); // outputs "five thousand one hundred twenty"
If you'd like to change the language, add the RFC 3066 language identifier in as a parameter.
\NumberToWords::toWords(5120, 'es'); // outputs "cinco mil ciento veinte"
To add currency, supply the ISO 4217 currency identifier
\NumberToWords::toWords(512000, 'en', 'USD'); // outputs "five thousand one hundred twenty dollars"
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email oliver@cleveregg.io instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.