Return the part of the number before the decimal point
Does not taken into account the size of any fraction.
@return string
500792
public function getIntegerPart()
	{
		if ( ! $this->getIsDecimal() ) return $this->_value;
		return substr( $this->_value, 0, strpos( $this->_value, "." ) );
	}
43633
private static function getDecimalPrecision($value)
    {
        $lc = localeconv();

        $decimal_pos = mb_strpos((string) $value, $lc['decimal_point']);

        return $decimal_pos !== false
            ? mb_strlen($value) - $decimal_pos - mb_strlen($lc['decimal_point'])
            : 0;
    }
229933
protected function getNumberFormatter()
    {
        $formatter = new \NumberFormatter($this->locale ?? \Locale::getDefault(), \NumberFormatter::DECIMAL);

        if (null !== $this->scale) {
            $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $this->scale);
            $formatter->setAttribute(\NumberFormatter::ROUNDING_MODE, $this->roundingMode);
        }

        $formatter->setAttribute(\NumberFormatter::GROUPING_USED, $this->grouping);

        return $formatter;
    }
453514
protected function getNumberFormatter()
    {
        $formatter = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL);

        $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $this->scale);

        return $formatter;
    }
565882
public static function trim($n)
    {
        $float         = floatval($n);
        $decimalPlaces = 0;

        // If the number rounded to $decimalPlaces isn't equal to the float val, add another decimal place and try again
        while ($float != round($float, $decimalPlaces)) {
            $decimalPlaces++;
        }

        $decimalPlaces = ($decimalPlaces < 2) ? 2 : $decimalPlaces;

        return number_format($float, $decimalPlaces, ".", "");
    }
390889
public static function eulerMascheroni(): Decimal
    {
        if (null === self::$EulerMascheroni) {
            self::$EulerMascheroni = Decimal::fromString(
                "0.57721566490153286060651209008240"
            );
        }
        return self::$EulerMascheroni;
    }
1037499
public function getAmountCents()
    {
        if ($this->getNotForPayment()) {
            return 'XX';
        }
        $amount = $this->getAmount();
        $francs = intval($amount);
        $cents = round(($amount - $francs) * 100);
        return str_pad($cents, 2, '0', STR_PAD_LEFT);
    }
173160
public function castDecimal()
    {
        $min   = (float) 4.9E-324;
        $max   = (float) 1.7976931348623157E+308;
        $value = (float) $this->value;

        if ($value >= $min && $value <= $max) {
            return $value;
        }

        $castFunction = function($value) use ($min,$max) {
            if ($value < $min ) {
                return $min;
            }

            if ($value > $max) {
                return $max;
            }

            return (float) $value;
        };

        if (is_numeric($this->value)) {
            return $castFunction($this->value);
        }

        return $this->handleMismatch($castFunction, 'decimal');
    }
1250653
protected function getNumberType()
    {
        $scale = $this->getScale();
        if ($scale === 0) {
            return PHP_INT_SIZE > 4
                ? NumberFormatter::TYPE_INT64
                : NumberFormatter::TYPE_INT32;
        }
        return NumberFormatter::TYPE_DOUBLE;
    }
484065
public function numeric()
    {
        $ret = array();
        foreach (self::$ordinality as $part) {
            if ($part === self::STABILITY) {
                $ret[]= array_search($this->get($part), self::$stabilities);
            } else {
                $ret[]= $this->get($part);
            }
        }
        return $ret;
    }
1109156
public static function pi(): Decimal
    {
        if (null === self::$PI) {
            self::$PI = Decimal::fromString(
                "3.14159265358979323846264338327950"
            );
        }
        return self::$PI;
    }
38468
public function NiceDecimalPoint()
    {
        $currencySymbol = Currency::config()->get('currency_symbol');
        $decimalPoint = Currency::config()->get('decimal_point');
        $thousandSeparator = Currency::config()->get('thousand_seperator');
        $val = $currencySymbol . number_format(abs($this->owner->value), 2, $decimalPoint, $thousandSeparator);
        if ((double)$this->owner->value === (double)0) {
            return _t('CurrencyExtension.FREE', 'Free');
        } elseif ((double)$this->owner->value < 0) {
            return "($val)";
        } else {
            return $val;
        }
    }
1030416
public function parseFloat()
    {
        try {
            if (Endianness::LITTLE()) {
                return \unpack('f', \strrev(mb_orig_substr($this->buffer, 0, 4)))[1];
            }
            return \unpack('f', $this->buffer)[1]; // @codeCoverageIgnore
        } finally {
            $this->buffer = mb_orig_substr($this->buffer, 4);
        }
    }
1340321
public function getCeil()
	{
		if ( $this->getIsDecimal() === false )
		{
			return $this;
		}

		if ( $this->getIsNegative() === true )
		{
			return new DecimalValue( bcadd( $this->_value, '0', 0 ) );
		}

		return new DecimalValue( bcadd( $this->_value, '1', 0 ) );  // Add one and truncate
	}
102155
public function bitwiseNot()
    {
        // calculuate "not" without regard to $this->precision
        // (will always result in a smaller number. ie. ~1 isn't 1111 1110 - it's 0)
        $temp = $this->toBytes();
        $pre_msb = decbin(ord($temp[0]));
        $temp = ~ $temp;
        $msb = decbin(ord($temp[0]));
        if (strlen($msb) == 8) {
            $msb = substr($msb, strpos($msb, '0'));
        }
        $temp[0] = chr(bindec($msb));

        // see if we need to add extra leading 1's
        $current_bits = strlen($pre_msb) + 8 * strlen($temp) - 8;
        $new_bits = $this->precision - $current_bits;
        if ($new_bits <= 0) {
            return $this->protectedNormalize(new BigInteger($temp, 256));
        }

        // generate as many leading 1's as we need to.
        $leading_ones = chr((1 << ($new_bits & 0x7)) - 1) . str_repeat(chr(0xFF), $new_bits >> 3);
        $this->protectedBase256LShift($leading_ones, $current_bits);

        $temp = str_pad($temp, ceil($this->bits / 8), chr(0), STR_PAD_LEFT);

        return $this->protectedNormalize(new BigInteger($leading_ones | $temp, 256));
    }
33078
public function getFormatter()
    {
        if ($this->formatterInstance === null) {
            $this->formatterInstance = Yii::createObject(
                [
                    'class' => '\yii\i18n\Formatter',
                    'decimalSeparator' => $this->decimal_separator,
                    'thousandSeparator' => $this->thousand_separator,
                    'numberFormatterOptions' => [
                        \NumberFormatter::MIN_FRACTION_DIGITS => $this->min_fraction_digits,
                        \NumberFormatter::MAX_FRACTION_DIGITS => $this->max_fraction_digits,
                    ]
                ]
            );
        }
        return $this->formatterInstance;
    }
815975
protected function getFormatter()
    {
        $formatter = new \NumberFormatter($this->locale, \NumberFormatter::DECIMAL);
        $precision = $this->field->getOption('precision', 0);

        if ($precision) {
            $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $precision);
        }

        return $formatter;
    }