Aplica formatação numérica.

@param $dec
@return $this
962508
public function number($dec, $zeroNull = true)
    {
        $val = floatval($this->value());
        if (($val == 0) && ($zeroNull)) {
            $this->value = '';
        } else {
            $this->value = number_format($val, $dec, ',', '.');
        }

        return $this;
    }
1218792
public static function format($number, $decimals = null, $decimalPoint = null,
                                  $thousandsSeparator = null)
    {
        if (is_null($decimals)) {
            $decimals = self::$decimals;
        }
        if (is_null($decimalPoint)) {
            $decimalPoint = self::$decimalPoint;
        }
        if (is_null($thousandsSeparator)) {
            $thousandsSeparator = self::$thousandsSeparator;
        }
        return number_format($number, $decimals, $decimalPoint, $thousandsSeparator);
    }
576033
public function sum($num, $type = 'd') {
        $typeSum = $this->converType($type);
        $typeSumString = ($num > 1) ? \Cityware\Format\Inflector::pluralize($typeSum) : $typeSum;
        $this->dateTime->add(date_interval_create_from_date_string($num . ' ' . $typeSumString));
        return $this;
    }
1156628
public function setNumberFormat(int $decimals, string $dec_point, string $thousands_sep)
    {
        $this->number_format = [
            'decimals'      => $decimals,
            'dec_point'     => $dec_point,
            'thousands_sep' => $thousands_sep,
        ];

        return $this;
    }
1099597
public function setFormat($format)
    {
        $this->format = (string) $format;

        foreach ($this->items as $time) {

            $time->setFormat($format);
        }

        return $this;
    }
1110673
public function setFormat($name, FormatInterface $format)
    {
        // If name is int or null, get name from Format object.
        $name = (is_numeric($name) || !$name) ? $format->getName() : $name;

        $this->formats[$name] = $format;

        return $this;
    }
1103048
public function Format($FormatMethod) {
		$Result = &$this->Result();
		foreach($Result as $Index => $Value) {
			$Result[$Index] = Gdn_Format::To($Value, $FormatMethod);
		}
		return $this;
	}
611355
public function setFormatCode($pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL)
	{
		if ($pValue == '') {
			$pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
		}
		if ($this->_isSupervisor) {
			$styleArray = $this->getStyleArray(array('code' => $pValue));
			$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
		} else {
			$this->_formatCode = $pValue;
			$this->_builtInFormatCode = self::builtInFormatCodeIndex($pValue);
		}
		return $this;
	}
822668
public function formatAmount(Money $money, $decPoint = ',', $thousandsSep = ' ')
    {
        return $this->moneyFormatter->formatAmount($money, $decPoint, $thousandsSep);
    }
299075
private function encodeHex($dec)
    {
        $hexchars = '0123456789ABCDEF';
        $return   = '';
        while (bccomp($dec, 0) == 1) {
            $rem    = (integer)bcmod($dec, '16');
            $dec    = (string)bcdiv($dec, '16', 0);
            $return = $return . $hexchars[$rem];
        }

        return strrev($return);
    }
13221
public function setFormat($value = null)
    {
        if ($value != null) {
            $this->_params['format'] = $value;
        } else {
            unset($this->_params['format']);
        }
        return $this;
    }
56561
public function formatByIntlLocalizedDecimal(
        $locale = null,
        Currencies $currencies = null,
        $style = NumberFormatter::CURRENCY
    ) {
        $numberFormatter = new NumberFormatter($locale ?: static::getLocale(), $style);
        $formatter = new IntlLocalizedDecimalFormatter($numberFormatter, $currencies ?: static::getCurrencies());

        return $this->formatByFormatter($formatter);
    }
995609
static function format_number($number) {
        $formatted = rtrim(format_float($number, 4),'0');
        if (substr($formatted, -1)==get_string('decsep', 'langconfig')) { //if last char is the decimal point
            $formatted .= '0';
        }
        return $formatted;
    }
860836
public function formatSimple()
    {
        return number_format(
            $this->getValue(),
            $this->currency->getPrecision(),
            $this->currency->getDecimalMark(),
            $this->currency->getThousandsSeparator()
        );
    }
1215597
public function format($format, $language = 'en')
    {
        $this->format = $format;
        $this->language = $language;

        return $this;
    }
1053335
public function round($precision = 0, $mode = PHP_ROUND_HALF_UP)
    {
        $this->number = round($this->number, $precision, $mode);

        return $this;
    }
459165
public function formatAmount(Money $money, $decPoint = ',', $thousandsSep = ' ')
    {
        $amount = $this->asFloat($money);
        $amount = number_format($amount, $this->decimals, $decPoint, $thousandsSep);

        return $amount;
    }