ICanBoogie/CLDR v1.6.0
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • CLDR

Classes

  • Calendar
  • CalendarCollection
  • ContextTransforms
  • Currency
  • CurrencyCollection
  • CurrencyFormatter
  • DateFormatter
  • DateTimeFormatter
  • FileProvider
  • ListFormatter
  • Locale
  • LocaleCollection
  • LocalizedCurrency
  • LocalizedDateTime
  • LocalizedListFormatter
  • LocalizedLocale
  • LocalizedNumberFormatter
  • LocalizedObject
  • LocalizedObjectWithFormatter
  • LocalizedTerritory
  • NumberFormatter
  • NumberPattern
  • NumberPatternParser
  • Numbers
  • ProviderCollection
  • RedisProvider
  • Repository
  • RunTimeProvider
  • Supplemental
  • Territory
  • TerritoryCollection
  • TimeFormatter
  • WebProvider

Interfaces

  • Exception
  • Formatter
  • LocalizeAwareInterface
  • Provider

Traits

  • CodePropertyTrait
  • CollectionTrait
  • LocalePropertyTrait
  • 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

Direct known subclasses

ICanBoogie\CLDR\CurrencyFormatter

Namespace: ICanBoogie\CLDR
Located at NumberFormatter.php

Methods summary

public static integer
# precision_from( number $number )

Returns the precision of a number.

Returns the precision of a number.

Parameters

$number

Returns

integer
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.

Parameters

$number
$precision

Returns

float
public static array
# parse_number( number $number, null|integer $precision = null )

Parses a number.

Parses a number.

Parameters

$number
$precision

Returns

array
public
# __construct( ICanBoogie\CLDR\Repository $repository = null )

Parameters

$repository
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.
public ICanBoogie\CLDR\LocalizedNumberFormatter
# localize( string $locale_code )

Localize the instance.

Localize the instance.

Parameters

$locale_code

Returns

ICanBoogie\CLDR\LocalizedNumberFormatter

Throw

\LogicException when the instance was created without a repository.

Methods used from ICanBoogie\CLDR\RepositoryPropertyTrait

get_repository()

Properties summary

Magic properties used from ICanBoogie\CLDR\RepositoryPropertyTrait

$repository

ICanBoogie/CLDR v1.6.0 API documentation generated by ApiGen