ICanBoogie
  • Documentation
  • API Reference
  • CLDR master
Namespaces
  • ICanBoogie
    • CLDR
      • Plurals
      • Units
Classes
  • AbstractCollection
  • AbstractSectionCollection
  • Calendar
  • CalendarCollection
  • ContextTransforms
  • Currency
  • CurrencyCollection
  • CurrencyFormatter
  • DateFormatter
  • DateTimeAccessor
  • DateTimeFormatter
  • FileProvider
  • ListFormatter
  • Locale
  • LocaleCollection
  • LocalizedCurrency
  • LocalizedDateTime
  • LocalizedListFormatter
  • LocalizedLocale
  • LocalizedNumberFormatter
  • LocalizedObject
  • LocalizedObjectWithFormatter
  • LocalizedTerritory
  • Number
  • NumberFormatter
  • NumberPattern
  • NumberPatternParser
  • Numbers
  • Plurals
  • ProviderCollection
  • RedisProvider
  • Repository
  • RunTimeProvider
  • Supplemental
  • Territory
  • TerritoryCollection
  • TimeFormatter
  • Units
  • WebProvider
Interfaces
  • Exception
  • Formatter
  • LocalizeAwareInterface
  • Provider
Traits
  • CodePropertyTrait
  • CollectionTrait
  • LocalePropertyTrait
  • LocalizeTrait
  • ProviderStorageBinding
  • RepositoryPropertyTrait
Exceptions
  • ResourceNotFound
  • TerritoryNotDefined

Class NumberFormatter

Formats numbers.

ICanBoogie\CLDR\NumberFormatter implements ICanBoogie\CLDR\Formatter uses ICanBoogie\Accessor\AccessorTrait (not available) ICanBoogie\CLDR\RepositoryPropertyTrait, ICanBoogie\CLDR\LocalizeTrait

Direct known subclasses

ICanBoogie\CLDR\CurrencyFormatter

Namespace: ICanBoogie\CLDR
Located at NumberFormatter.php

Methods summary

public static precision_from( number $number ) : integer

Returns the precision of a number.

Returns the precision of a number.

Deprecated

Parameters

$number

Returns

integer

See

Number::precision_from()
public static round_to( number $number, integer $precision ) : float

Returns a number rounded to the specified precision.

Returns a number rounded to the specified precision.

Deprecated

Parameters

$number
$precision

Returns

float

See

Number::round_to()
public static parse_number( number $number, null|integer $precision = null ) : array

Parses a number.

Parses a number.

Deprecated

Parameters

$number
$precision

Returns

array

See

Number::parse()
public __construct( ICanBoogie\CLDR\Repository $repository = null )

Parameters

$repository
public __invoke( mixed $number, string $pattern, array $symbols = [] ) : string

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 format( mixed $number, string $pattern, array $symbols = [] ) : string

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.

Methods used from ICanBoogie\CLDR\RepositoryPropertyTrait

get_repository()

Methods used from ICanBoogie\CLDR\LocalizeTrait

localize()

Magic methods summary

public localize( $locale_code ) : ICanBoogie\CLDR\LocalizedNumberFormatter

Parameters

$locale_code

Returns

ICanBoogie\CLDR\LocalizedNumberFormatter

Properties summary

Magic properties used from ICanBoogie\CLDR\RepositoryPropertyTrait

$repository

CLDR master – Check on GitHub – API documentation generated by ApiGen