Documentation

ConvertOctal extends ConvertBase
in package

Table of Contents

Properties

$arrayArgumentHelper  : ArrayArgumentHelper
$initializationNeeded  : bool

Methods

toBinary()  : array<string|int, mixed>|string
toBinary.
toDecimal()  : array<string|int, mixed>|string
toDecimal.
toHex()  : array<string|int, mixed>|string
toHex.
evaluateArrayArguments()  : array<string|int, mixed>
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
evaluateArrayArgumentsIgnore()  : array<string|int, mixed>
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
evaluateArrayArgumentsSubset()  : array<string|int, mixed>
Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
evaluateArrayArgumentsSubsetFrom()  : array<string|int, mixed>
Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
evaluateSingleArgumentArray()  : array<string|int, mixed>
Handles array argument processing when the function accepts a single argument that can be an array argument.
nbrConversionFormat()  : string
Formats a number base string value with leading zeroes.
validateOctal()  : string
validatePlaces()  : int|null
validateValue()  : string
initialiseHelper()  : void
testFalse()  : bool

Properties

$initializationNeeded

private static bool $initializationNeeded = true

Methods

toBinary()

toBinary.

public static toBinary(array<string|int, mixed>|bool|float|int|string $value[, array<string|int, mixed>|int $places = null ]) : array<string|int, mixed>|string

Return an octal value as binary.

Excel Function: OCT2BIN(x[,places])

Parameters
$value : array<string|int, mixed>|bool|float|int|string

The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. If number is negative, OCT2BIN ignores places and returns a 10-character binary number. If number is negative, it cannot be less than 7777777000, and if number is positive, it cannot be greater than 777. If number is not a valid octal number, OCT2BIN returns the #NUM! error value. If OCT2BIN requires more than places characters, it returns the #NUM! error value. Or can be an array of values

$places : array<string|int, mixed>|int = null

The number of characters to use. If places is omitted, OCT2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). If places is not an integer, it is truncated. If places is nonnumeric, OCT2BIN returns the #VALUE! error value. If places is negative, OCT2BIN returns the #NUM! error value. Or can be an array of values

Return values
array<string|int, mixed>|string

Result, or an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions

toDecimal()

toDecimal.

public static toDecimal(array<string|int, mixed>|bool|float|int|string $value) : array<string|int, mixed>|string

Return an octal value as decimal.

Excel Function: OCT2DEC(x)

Parameters
$value : array<string|int, mixed>|bool|float|int|string

The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. If number is not a valid octal number, OCT2DEC returns the #NUM! error value. Or can be an array of values

Return values
array<string|int, mixed>|string

Result, or an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions

toHex()

toHex.

public static toHex(array<string|int, mixed>|bool|float|int|string $value[, array<string|int, mixed>|int $places = null ]) : array<string|int, mixed>|string

Return an octal value as hex.

Excel Function: OCT2HEX(x[,places])

Parameters
$value : array<string|int, mixed>|bool|float|int|string

The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. If number is negative, OCT2HEX ignores places and returns a 10-character hexadecimal number. If number is not a valid octal number, OCT2HEX returns the #NUM! error value. If OCT2HEX requires more than places characters, it returns the #NUM! error value. Or can be an array of values

$places : array<string|int, mixed>|int = null

The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). If places is not an integer, it is truncated. If places is nonnumeric, OCT2HEX returns the #VALUE! error value. If places is negative, OCT2HEX returns the #NUM! error value. Or can be an array of values

Return values
array<string|int, mixed>|string

Result, or an error If an array of numbers is passed as an argument, then the returned result will also be an array with the same dimensions

evaluateArrayArguments()

Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.

protected static evaluateArrayArguments(callable $method, mixed ...$arguments) : array<string|int, mixed>

Example use for: ROUND() or DATE().

Parameters
$method : callable
$arguments : mixed
Return values
array<string|int, mixed>

evaluateArrayArgumentsIgnore()

Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.

protected static evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments) : array<string|int, mixed>

Example use for: HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database rather than as an array argument.

Parameters
$method : callable
$ignore : int
$arguments : mixed
Return values
array<string|int, mixed>

evaluateArrayArgumentsSubset()

Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.

protected static evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments) : array<string|int, mixed>

Example use for: NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need to be treated as a such rather than as an array arguments.

Parameters
$method : callable
$limit : int
$arguments : mixed
Return values
array<string|int, mixed>

evaluateArrayArgumentsSubsetFrom()

Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.

protected static evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments) : array<string|int, mixed>

Example use for: Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset rather than as an array argument.

Parameters
$method : callable
$start : int
$arguments : mixed
Return values
array<string|int, mixed>

evaluateSingleArgumentArray()

Handles array argument processing when the function accepts a single argument that can be an array argument.

protected static evaluateSingleArgumentArray(callable $method, array<string|int, mixed> $values) : array<string|int, mixed>

Example use for: DAYOFMONTH() or FACT().

Parameters
$method : callable
$values : array<string|int, mixed>
Return values
array<string|int, mixed>

nbrConversionFormat()

Formats a number base string value with leading zeroes.

protected static nbrConversionFormat(string $value, int|null $places) : string
Parameters
$value : string

The "number" to pad

$places : int|null

The length that we want to pad this value

Return values
string

The padded "number"

validateOctal()

protected static validateOctal(string $value) : string
Parameters
$value : string
Return values
string

validatePlaces()

protected static validatePlaces([mixed $places = null ]) : int|null
Parameters
$places : mixed = null
Return values
int|null

validateValue()

protected static validateValue(mixed $value) : string
Parameters
$value : mixed
Return values
string

initialiseHelper()

private static initialiseHelper(array<string|int, mixed>|false $arguments) : void
Parameters
$arguments : array<string|int, mixed>|false

Can be changed to array for Php8.1+

testFalse()

private static testFalse(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

        
On this page

Search results