How to Write Out Numbers Using Words
Writing out numbers can be intimidating. Fortunately, in most situations, you just need to make things clear enough to avoid major confusion and disputes. For example, when writing a check, banks will only reference the words to verify the numerals written elsewhere on the check.
A few examples:
Input | Output |
---|---|
0 | "zero dollars" |
0.12 | "twelve cents" or "12/100" |
10.55 | "ten dollars and fifty five cents" or "ten dollars and 55/100" |
120 | "one hundred twenty dollars" |
Read tests/Treasure/MoneyTest
and run ./vendor/bin/phpunit
to verify it works.