Documentation

Format

Table of Contents

DOLLAR() DOLLAR. string
FIXEDFORMAT() FIXEDFORMAT. string
TEXTFORMAT() TEXTFORMAT. string
VALUE() VALUE. DateTimeInterface|float|int|string
NUMBERVALUE() NUMBERVALUE. float|string

Methods

DOLLAR()

DOLLAR.

public static DOLLAR( $value : mixed [, $decimals : mixed = 2 ] ) : 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

The value to format

$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

Return values
string

FIXEDFORMAT()

FIXEDFORMAT.

public static FIXEDFORMAT( $value : mixed [, $decimals : mixed = 2 ] [, $noCommas : mixed = false ] ) : string
Parameters
$value : mixed

The value to format

$decimals : mixed = 2

Integer value for the number of decimal places that should be formatted

$noCommas : mixed = false

Boolean value indicating whether the value should have thousands separators or not

Return values
string

TEXTFORMAT()

TEXTFORMAT.

public static TEXTFORMAT( $value : mixed , $format : mixed ) : string
Parameters
$value : mixed

The value to format

$format : mixed

A string with the Format mask that should be used

Return values
string

VALUE()

VALUE.

public static VALUE( [ $value : mixed = '' ] ) : DateTimeInterface|float|int|string
Parameters
$value : mixed = ''

Value to check

Return values
DateTimeInterface|float|int|string

A string if arguments are invalid

NUMBERVALUE()

NUMBERVALUE.

public static NUMBERVALUE( [ $value : mixed = '' ] [, $decimalSeparator : mixed = null ] [, $groupSeparator : mixed = null ] ) : float|string
Parameters
$value : mixed = ''

The value to format

$decimalSeparator : mixed = null

A string with the decimal separator to use, defaults to locale defined value

$groupSeparator : mixed = null

A string with the group/thousands separator to use, defaults to locale defined value

Return values
float|string

Search results