Documentation

NumberFormatter extends BaseFormatter
in package

Table of Contents

Methods

areThousandsRequired()  : bool
Find out if we need thousands separator This is indicated by a comma enclosed by a digit placeholders: #, 0 or ?
f2s()  : string
floatStringConvertScientific()  : string
format()  : string
padValue()  : string
scaleThousandsMillions()  : int
Scale thousands, millions,... This is indicated by a number of commas after a digit placeholder: #, or 0.0,, or ?,.
adjustSeparators()  : string
stripQuotes()  : string

Methods

areThousandsRequired()

Find out if we need thousands separator This is indicated by a comma enclosed by a digit placeholders: #, 0 or ?

public static areThousandsRequired(string &$format) : bool
Parameters
$format : string
Return values
bool

f2s()

public static f2s(float $f) : string
Parameters
$f : float
Return values
string

floatStringConvertScientific()

public static floatStringConvertScientific(string $s) : string
Parameters
$s : string
Return values
string

format()

public static format(float|int|numeric-string $value, string $format) : string
Parameters
$value : float|int|numeric-string

value to be formatted

$format : string
Return values
string

padValue()

public static padValue(string $value, string $baseFormat) : string
Parameters
$value : string
$baseFormat : string
Return values
string

scaleThousandsMillions()

Scale thousands, millions,... This is indicated by a number of commas after a digit placeholder: #, or 0.0,, or ?,.

public static scaleThousandsMillions(string &$format) : int
Parameters
$format : string
Return values
int

adjustSeparators()

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

stripQuotes()

protected static stripQuotes(string $format) : string
Parameters
$format : string
Return values
string

        
On this page

Search results