Neos\Flow\I18n\Formatter\NumberFormatter::format PHP Метод

format() публичный Метод

Formats provided value using optional style properties
public format ( mixed $value, Locale $locale, array $styleProperties = [] ) : string
$value mixed Formatter-specific variable to format (can be integer, \DateTime, etc)
$locale Neos\Flow\I18n\Locale Locale to use
$styleProperties array Integer-indexed array of formatter-specific style properties (can be empty)
Результат string String representation of $value provided, or (string)$value
    public function format($value, Locale $locale, array $styleProperties = [])
    {
        if (isset($styleProperties[0])) {
            $formatType = $styleProperties[0];
            NumbersReader::validateFormatType($formatType);
        } else {
            $formatType = NumbersReader::FORMAT_TYPE_DECIMAL;
        }
        switch ($formatType) {
            case NumbersReader::FORMAT_TYPE_PERCENT:
                return $this->formatPercentNumber($value, $locale, NumbersReader::FORMAT_LENGTH_DEFAULT);
            default:
                return $this->formatDecimalNumber($value, $locale, NumbersReader::FORMAT_LENGTH_DEFAULT);
        }
    }