Twig/Extension.php
public function numberFormat($number, int $decimals = 0): string
    {
        if (!isset($this->numberFormatter)) {
            $this->numberFormatter = new NumberFormatter($this->intuition->getLang(), NumberFormatter::DECIMAL);
        }
        $this->numberFormatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
        return $this->numberFormatter->format($number);
    }
public function numberFormat($number, int $decimals = 0): string
    {
        if (!isset($this->numberFormatter)) {
            $this->numberFormatter = new NumberFormatter($this->intuition->getLang(), NumberFormatter::DECIMAL);
        }
        $this->numberFormatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
        return $this->numberFormatter->format($number);
    }
public function numberFormat ( $ number , int $ decimals = 0 ) : string { if ( ! isset ( $ this -> numberFormatter ) ) { $ this -> numberFormatter = new NumberFormatter ( $ this -> intuition -> getLang ( ) , NumberFormatter :: DECIMAL ) ; } $ this -> numberFormatter -> setAttribute ( NumberFormatter :: MAX_FRACTION_DIGITS , $ decimals ) ; return $ this -> numberFormatter -> format ( $ number ) ; }
Format a number based on language settings.
@param int|float $number
@param int $decimals Number of decimals to format to.
@return string
Format a number based on language settings .