Class NumberFormatter
-
ICanBoogie\CLDR\NumberFormatter
implements
ICanBoogie\CLDR\Formatter
uses
ICanBoogie\Accessor\AccessorTrait (not available)
ICanBoogie\CLDR\RepositoryPropertyTrait,
ICanBoogie\CLDR\LocalizeTrait
Methods summary
public static
integer
|
#
precision_from( number $number )
Returns the precision of a number.
Returns the precision of a number.
Deprecated
Parameters
Returns
integer
See
Number::precision_from()
|
public static
float
|
#
round_to( number $number, integer $precision )
Returns a number rounded to the specified precision.
Returns a number rounded to the specified precision.
Deprecated
Parameters
Returns
float
See
Number::round_to()
|
public static
array
|
#
parse_number( number $number, null|integer $precision = null )
Parses a number.
Deprecated
Parameters
Returns
array
See
Number::parse()
|
public
|
|
public
string
|
#
__invoke( mixed $number, string $pattern, array $symbols = [] )
Format a number with the specified pattern.
Format a number with the specified pattern.
Note, if the pattern contains '%', the number will be multiplied by 100 first. If the
pattern contains '‰', the number will be multiplied by 1000.
Parameters
- $number
- The number to be formatted.
- $pattern
- The pattern used to format the number.
- $symbols
- Symbols.
Returns
string The formatted number.
|
public
string
|
#
format( mixed $number, string $pattern, array $symbols = [] )
Format a number with the specified pattern.
Format a number with the specified pattern.
Note, if the pattern contains '%', the number will be multiplied by 100 first. If the
pattern contains '‰', the number will be multiplied by 1000.
Parameters
- $number
- The number to be formatted.
- $pattern
- The pattern used to format the number.
- $symbols
- Symbols.
Returns
string The formatted number.
|