Smile\ElasticsuiteCatalog\Model\Layer\Filter\Decimal::formatValue PHP Метод

formatValue() приватный Метод

Format value according to attribute display options
private formatValue ( mixed $value ) : string
$value mixed The value to format
Результат string
    private function formatValue($value)
    {
        $attribute = $this->getAttributeModel();
        if ((int) $attribute->getDisplayPrecision() > 0) {
            $locale = $this->localeResolver->getLocale();
            $options = ['locale' => $locale, 'precision' => (int) $attribute->getDisplayPrecision()];
            $valueFormatter = new \Zend_Filter_NormalizedToLocalized($options);
            $value = $valueFormatter->filter($value);
        }
        if ((string) $attribute->getDisplayPattern() != "") {
            $value = sprintf((string) $attribute->getDisplayPattern(), $value);
        }
        return $value;
    }