JBZoo\SimpleTypes\Formatter::_format PHP Метод

_format() защищенный Метод

Convert value to money format from config
protected _format ( float $value, string $rule ) : array
$value float
$rule string
Результат array
    protected function _format($value, $rule)
    {
        $format = (array) $this->get($rule);
        $value = (double) $value;
        $roundedValue = $this->round($value, $rule);
        $isPositive = $value >= 0;
        $valueStr = number_format(abs($roundedValue), $format['num_decimals'], $format['decimal_sep'], $format['thousands_sep']);
        $template = $isPositive ? $format['format_positive'] : $format['format_negative'];
        return array('value' => $valueStr, 'template' => $template, 'isPositive' => $isPositive);
    }