Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BigDecimal.php

function BigDecimal::getIntegralPart

Returns a string representing the integral part of this decimal number.

Example: `-123.456` => `-123`.

File

vendor/brick/math/src/BigDecimal.php, line 575

Class

BigDecimal
Immutable, arbitrary-precision signed decimal numbers.

Namespace

Brick\Math

Code

public function getIntegralPart() : string {
    if ($this->scale === 0) {
        return $this->value;
    }
    $value = $this->getUnscaledValueWithLeadingZeros();
    return \substr($value, 0, -$this->scale);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal