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

Breadcrumb

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

function Calculator::fromBase

Converts a number from an arbitrary base.

This method can be overridden by the concrete implementation if the underlying library has built-in support for base conversion.

Parameters

string $number The number, positive or zero, non-empty, case-insensitively validated for the given base.:

int $base The base of the number, validated from 2 to 36.:

Return value

string The converted number, following the Calculator conventions.

1 method overrides Calculator::fromBase()
GmpCalculator::fromBase in vendor/brick/math/src/Internal/Calculator/GmpCalculator.php
Converts a number from an arbitrary base.

File

vendor/brick/math/src/Internal/Calculator.php, line 320

Class

Calculator
Performs basic operations on arbitrary size integers.

Namespace

Brick\Math\Internal

Code

public function fromBase(string $number, int $base) : string {
    return $this->fromArbitraryBase(\strtolower($number), self::ALPHABET, $base);
}

API Navigation

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