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

Breadcrumb

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

function BigDecimal::withPointMovedLeft

Returns a copy of this BigDecimal with the decimal point moved $n places to the left.

1 call to BigDecimal::withPointMovedLeft()
BigDecimal::withPointMovedRight in vendor/brick/math/src/BigDecimal.php
Returns a copy of this BigDecimal with the decimal point moved $n places to the right.

File

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

Class

BigDecimal
Immutable, arbitrary-precision signed decimal numbers.

Namespace

Brick\Math

Code

public function withPointMovedLeft(int $n) : BigDecimal {
    if ($n === 0) {
        return $this;
    }
    if ($n < 0) {
        return $this->withPointMovedRight(-$n);
    }
    return new BigDecimal($this->value, $this->scale + $n);
}

API Navigation

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