numberformatter php how it work code example
Example: numberformatter php
$num = 1234567.891234567891;
$nf = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
echo $nf->format($num);
$nf = new NumberFormatter('uk_UA', NumberFormatter::CURRENCY);
echo $nf->formatCurrency($num, 'UAH');
$nf = new NumberFormatter('lt_LT', NumberFormatter::SPELLOUT);
echo $nf->format($num);
$nf = new NumberFormatter('en_US', NumberFormatter::DURATION);
echo $nf->format($num);
$nf = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$nf->setPattern('#,##0.### kg');
echo $nf->format($num);