return $this->
round($result);
} /**
* Returns a preconfigured \NumberFormatter instance.
*/
protected function getNumberFormatter(): \NumberFormatter
{ // Values used in HTML5 number inputs should be formatted as in "1234.5", ie. 'en' format without grouping,
// according to https://www.w3.org/TR/html51/sec-forms.html#date-time-and-number-formats
$formatter =
new \
NumberFormatter($this->html5Format ? 'en' : \Locale::
getDefault(), \NumberFormatter::DECIMAL
);
if ($this->html5Format
) { $formatter->
setAttribute(\NumberFormatter::GROUPING_USED, 0
);
} $formatter->
setAttribute(\NumberFormatter::FRACTION_DIGITS,
$this->scale
);
if (null !==
$this->roundingMode
) { $formatter->
setAttribute(\NumberFormatter::ROUNDING_MODE,
$this->roundingMode
);
}