Format
in package
uses
ArrayEnabled
Table of Contents
Properties
Methods
- DOLLAR() : array<string|int, mixed>|string
- DOLLAR.
- FIXEDFORMAT() : array<string|int, mixed>|string
- FIXED.
- NUMBERVALUE() : array<string|int, mixed>|string|float
- NUMBERVALUE.
- TEXTFORMAT() : array<string|int, mixed>|string
- TEXT.
- VALUE() : array<string|int, mixed>|DateTimeInterface|float|int|string
- VALUE.
- valueToText() : array<string|int, mixed>|string
- VALUETOTEXT.
- 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.
- convertValue() : mixed
- getDecimalSeparator() : string
- getGroupSeparator() : string
- initialiseHelper() : void
- testFalse() : bool
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
DOLLAR()
DOLLAR.
public
static DOLLAR([mixed $value = 0 ][, mixed $decimals = 2 ]) : array<string|int, mixed>|string
This function converts a number to text using currency format, with the decimals rounded to the specified place. The format used is $#,##0.00_);($#,##0.00)..
Parameters
- $value : mixed = 0
-
The value to format Or can be an array of values
- $decimals : mixed = 2
-
The number of digits to display to the right of the decimal point (as an integer). If decimals is negative, number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2 Or can be an array of values
Return values
array<string|int, mixed>|string —If an array of values is passed for either of the arguments, then the returned result will also be an array with matching dimensions
FIXEDFORMAT()
FIXED.
public
static FIXEDFORMAT(mixed $value[, mixed $decimals = 2 ][, mixed $noCommas = false ]) : array<string|int, mixed>|string
Parameters
- $value : mixed
-
The value to format Or can be an array of values
- $decimals : mixed = 2
-
Integer value for the number of decimal places that should be formatted Or can be an array of values
- $noCommas : mixed = false
-
Boolean value indicating whether the value should have thousands separators or not Or can be an array of values
Return values
array<string|int, mixed>|string —If an array of values is passed for either of the arguments, then the returned result will also be an array with matching dimensions
NUMBERVALUE()
NUMBERVALUE.
public
static NUMBERVALUE([mixed $value = '' ][, mixed $decimalSeparator = null ][, mixed $groupSeparator = null ]) : array<string|int, mixed>|string|float
Parameters
- $value : mixed = ''
-
The value to format Or can be an array of values
- $decimalSeparator : mixed = null
-
A string with the decimal separator to use, defaults to locale defined value Or can be an array of values
- $groupSeparator : mixed = null
-
A string with the group/thousands separator to use, defaults to locale defined value Or can be an array of values
Return values
array<string|int, mixed>|string|floatTEXTFORMAT()
TEXT.
public
static TEXTFORMAT(mixed $value, mixed $format) : array<string|int, mixed>|string
Parameters
- $value : mixed
-
The value to format Or can be an array of values
- $format : mixed
-
A string with the Format mask that should be used Or can be an array of values
Return values
array<string|int, mixed>|string —If an array of values is passed for either of the arguments, then the returned result will also be an array with matching dimensions
VALUE()
VALUE.
public
static VALUE([mixed $value = '' ]) : array<string|int, mixed>|DateTimeInterface|float|int|string
Parameters
- $value : mixed = ''
-
Value to check Or can be an array of values
Return values
array<string|int, mixed>|DateTimeInterface|float|int|string —A string if arguments are invalid If an array of values is passed for the argument, then the returned result will also be an array with matching dimensions
valueToText()
VALUETOTEXT.
public
static valueToText(mixed $value[, mixed $format = false ]) : array<string|int, mixed>|string
Parameters
- $value : mixed
-
The value to format Or can be an array of values
- $format : mixed = false
Return values
array<string|int, mixed>|string —If an array of values is passed for either of the arguments, then the returned result will also be an array with matching 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>convertValue()
private
static convertValue(mixed $value[, bool $spacesMeanZero = false ]) : mixed
Parameters
- $value : mixed
-
Value to check
- $spacesMeanZero : bool = false
getDecimalSeparator()
private
static getDecimalSeparator(mixed $decimalSeparator) : string
Parameters
- $decimalSeparator : mixed
Return values
stringgetGroupSeparator()
private
static getGroupSeparator(mixed $groupSeparator) : string
Parameters
- $groupSeparator : mixed
Return values
stringinitialiseHelper()
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