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

Breadcrumb

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

function BigDecimal::zero

Returns a BigDecimal representing zero, with a scale of zero.

@psalm-pure

1 call to BigDecimal::zero()
BigDecimal::stripTrailingZeros in vendor/brick/math/src/BigDecimal.php
Returns a copy of this BigDecimal with any trailing zeros removed from the fractional part.

File

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

Class

BigDecimal
Immutable, arbitrary-precision signed decimal numbers.

Namespace

Brick\Math

Code

public static function zero() : BigDecimal {
    
    /**
     * @psalm-suppress ImpureStaticVariable
     * @var BigDecimal|null $zero
     */
    static $zero;
    if ($zero === null) {
        $zero = new BigDecimal('0');
    }
    return $zero;
}

API Navigation

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