protected function localizeNumber($number, NumberFormat $numberFormat)
    {
        // Localize digits.
        $numberingSystem = $numberFormat->getNumberingSystem();
        if (isset($this->digits[$numberingSystem])) {
            $number = strtr($number, $this->digits[$numberingSystem]);
        }
        // Localize symbols.
        $replacements = [
            '.' => $numberFormat->getDecimalSeparator(),
            ',' => $numberFormat->getGroupingSeparator(),
            '+' => $numberFormat->getPlusSign(),
            '-' => $numberFormat->getMinusSign(),
            '%' => $numberFormat->getPercentSign(),
        ];
        $number = strtr($number, $replacements);

        return $number;
    }
protected function localizeNumber($number, NumberFormat $numberFormat)
    {
        // Localize digits.
        $numberingSystem = $numberFormat->getNumberingSystem();
        if (isset($this->digits[$numberingSystem])) {
            $number = strtr($number, $this->digits[$numberingSystem]);
        }
        // Localize symbols.
        $replacements = [
            '.' => $numberFormat->getDecimalSeparator(),
            ',' => $numberFormat->getGroupingSeparator(),
            '+' => $numberFormat->getPlusSign(),
            '-' => $numberFormat->getMinusSign(),
            '%' => $numberFormat->getPercentSign(),
        ];
        $number = strtr($number, $replacements);

        return $number;
    }
protected function localizeNumber ( $ number , NumberFormat $ numberFormat ) { // Localize digits. $ numberingSystem = $ numberFormat -> getNumberingSystem ( ) ; if ( isset ( $ this -> digits [ $ numberingSystem ] ) ) { $ number = strtr ( $ number , $ this -> digits [ $ numberingSystem ] ) ; } // Localize symbols. $ replacements = [ '.' => $ numberFormat -> getDecimalSeparator ( ) , ',' => $ numberFormat -> getGroupingSeparator ( ) , '+' => $ numberFormat -> getPlusSign ( ) , '-' => $ numberFormat -> getMinusSign ( ) , '%' => $ numberFormat -> getPercentSign ( ) , ] ; $ number = strtr ( $ number , $ replacements ) ; return $ number ; }
Localizes the number according to the number format.

Both the digits and the symbols are replaced
with their localized equivalents.

@param string       $number       The number.
@param NumberFormat $numberFormat The number format.

@return string The localized number.

@see http://cldr.unicode.org/translation/number-symbols
Localizes the number according to the number format .