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

Breadcrumb

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

function BigNumber::cleanUp

Removes optional leading zeros and applies sign.

@psalm-pure

Parameters

string|null $sign The sign, '+' or '-', optional. Null is allowed for convenience and treated as '+'.:

string $number The number, validated as a non-empty string of digits.:

1 call to BigNumber::cleanUp()
BigNumber::_of in vendor/brick/math/src/BigNumber.php
@psalm-pure

File

vendor/brick/math/src/BigNumber.php, line 335

Class

BigNumber
Common interface for arbitrary-precision rational numbers.

Namespace

Brick\Math

Code

private static function cleanUp(string|null $sign, string $number) : string {
    $number = \ltrim($number, '0');
    if ($number === '') {
        return '0';
    }
    return $sign === '-' ? '-' . $number : $number;
}

API Navigation

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