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
boolf2s()
public
static f2s(float $f) : string
Parameters
- $f : float
Return values
stringfloatStringConvertScientific()
public
static floatStringConvertScientific(string $s) : string
Parameters
- $s : string
Return values
stringformat()
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
stringpadValue()
public
static padValue(string $value, string $baseFormat) : string
Parameters
- $value : string
- $baseFormat : string
Return values
stringscaleThousandsMillions()
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
intadjustSeparators()
protected
static adjustSeparators(string $value) : string
Parameters
- $value : string
Return values
stringstripQuotes()
protected
static stripQuotes(string $format) : string
Parameters
- $format : string