byjg / wordnumber
Write float number in a word number.
Fund package maintenance!
byjg
5.0.0
2024-10-29 22:29 UTC
Requires
- php: >=8.1 <8.4
Requires (Dev)
- phpunit/phpunit: ^9.6
- vimeo/psalm: ^5.9
README
Write float number in a word number.
Support multiple languages. Until this moment supports
- English
- Portuguese
- Italian (Thanks to willypuzzle)
Examples
$wordNumber = new ByJG\WordNumber\EnglishWordNumber(); $wordnumber->write(12.34); # writes twelve dollars and third four cents
or
$wordNumber = new ByJG\WordNumber\PortugueseWordNumber(); $wordnumber->write(12.34); # writes doze reais e trinta e quatro centavos.
Create other languages
You have to implement the interface WordNumberInterface with the proper word number in your language. If you create feel free to send to us.
interface WordNumberInterface { public function concatWord(); public function currency(); public function tens(); public function unit(); public function elevenToNineteen(); public function twentyToNinety(); public function hundreds(); public function oneHundred(); }