Skip to content

NumberFormatRepository

Provides number formats.

Properties

fallbackLocale

The fallback locale.

protected string $fallbackLocale

Methods

__construct

Creates a NumberFormatRepository instance.

public __construct(string $fallbackLocale = 'en'): mixed

Parameters:

Parameter Type Description
$fallbackLocale string The fallback locale. Defaults to 'en'.

get

Gets a number format for the provided locale.

public get(mixed $locale): \CommerceGuys\Intl\NumberFormat\NumberFormat

Parameters:

Parameter Type Description
$locale mixed The locale (i.e. fr-FR).

processDefinition

Processes the number format definition for the provided locale.

protected processDefinition(string $locale, array $definition): array

Parameters:

Parameter Type Description
$locale string The locale.
$definition array The definition

Return Value:

The processed definition.


getDefinitions

Gets the number format definitions.

protected getDefinitions(): array

Return Value:

The number format definitions, keyed by locale.



Automatically generated on 2025-03-18