Search code examples
phpnumberformatter

Where is the source code of PHP intl NumberFormatter::SPELLOUT?


Where can I find the PHP source code behind NumberFormatter::SPELLOUT ?

$f = new NumberFormatter("en", NumberFormatter::SPELLOUT);
echo $f->format(456);

// four hundred fifty-six

I don't find the algorithm of NumberFormatter::SPELLOUT in these links:


Solution

  • as the intl extension is just a binding to the C ICU library you will find here what you are looking for:

    https://github.com/unicode-org/icu/search?q=spellout&unscoped_q=spellout