Property | Type | Description | |
---|---|---|---|
$cache | Neos\Cache\Frontend\VariableFrontend | ||
$cldrRepository | |||
$localizedSymbols | array | Locale identifiers are keys for this array. Values are arrays of symbols, as defined in /ldml/numbers/symbols path in CLDR files. | |
$parsedFormats | array | Example of data stored in this array (default values): '#,##0.###' => array( 'positivePrefix' => '', 'positiveSuffix' => '', 'negativePrefix' => '-', 'negativeSuffix' => '', 'multiplier' => 1, 'minDecimalDigits' => 0, 'maxDecimalDigits' => 0, 'minIntegerDigits' => 1, 'primaryGroupingSize' => 0, 'secondaryGroupingSize' => 0, 'rounding' => 0.0, ); Legend: - positivePrefix / positiveSuffix: a character to place before / after the number, if it's positive. - negativePrefix / Suffix: same as above, but for negative numbers. - multiplier: Used for percents or permiles (100 and 1000 accordingly). - minDecimalDigits: same as above, but for decimal part of the number. No less than 0 (which means no decimal part). - maxDecimalDigits: same as above, but for decimal part of the number. No less than 0 (which means no decimal part). - minIntegerDigits: at least so many digits will be printed for integer part of the number (padded with zeros if needed). No less than 1. - primaryGroupingSize: Where to put the first grouping separator (e.g. thousands). Zero means no separator (also no secondary separator!). - secondaryGroupingSize: Where to put the second grouping separators (used after the primary separator - eg for primaryGroupingSize set to 3 and secondaryGroupingSize set to 2, number 123456789 will be 12,34,56,789). For most languages, this is the same as primaryGroupingSize. - rounding: If set, number will be rounded to the multiple of this value. Can be float or integer. Zero means no rounding. Note: there can be characters in prefix / suffix elements which will be localized during formatting (eg minus sign, percent etc), or other chars which will be used as-is. | |
$parsedFormatsIndices | array | As for one locale there can be defined many formats (at most 3 format types supported by this class - decimal, percent, currency - multiplied by at most 5 format lengths - full, long, medium, short, and implicit length referred in this class as 'default'), references are organized in arrays. Example of data stored in this array: 'pl' => array( 'decimal' => array( 'default' => '#,##0.###', ... ), ... ); |
Method | Description | |
---|---|---|
getLocalizedSymbolsForLocale ( |
Returns symbols array for provided locale. | |
initializeObject ( ) : void | Constructs the reader, loading parsed data from cache if available. | |
injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void | Injects the Flow_I18n_CDLR_Reader_NumbersReader cache | |
injectCldrRepository ( |
||
parseCustomFormat ( string $format ) : array | Returns parsed date or time format string provided as parameter. | |
parseFormatFromCldr ( |
Returns parsed number format basing on locale and desired format length if provided. | |
shutdownObject ( ) : void | Shutdowns the object, saving parsed format strings to the cache. | |
validateFormatLength ( string $formatLength ) : void | Validates provided format length and throws exception if value is not allowed. | |
validateFormatType ( string $formatType ) : void | Validates provided format type and throws exception if value is not allowed. |
Method | Description | |
---|---|---|
parseFormat ( string $format ) : array | Parses a number format (with syntax defined in CLDR). |
public getLocalizedSymbolsForLocale ( |
||
$locale | ||
return | array | Symbols array |
public initializeObject ( ) : void | ||
return | void |
public injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void | ||
$cache | Neos\Cache\Frontend\VariableFrontend | |
return | void |
public injectCldrRepository ( |
||
$repository | ||
return | void |
public parseCustomFormat ( string $format ) : array | ||
$format | string | Format string to parse |
return | array | An array representing parsed format |
protected parseFormat ( string $format ) : array | ||
$format | string | |
return | array | Parsed format |
public parseFormatFromCldr ( |
||
$locale | ||
$formatType | string | A type of format (one of constant values) |
$formatLength | string | A length of format (one of constant values) |
return | array | An array representing parsed format |
public shutdownObject ( ) : void | ||
return | void |
public static validateFormatLength ( string $formatLength ) : void | ||
$formatLength | string | |
return | void |
public static validateFormatType ( string $formatType ) : void | ||
$formatType | string | |
return | void |
protected VariableFrontend,Neos\Cache\Frontend $cache | ||
return | Neos\Cache\Frontend\VariableFrontend |
protected CldrRepository,Neos\Flow\I18n\Cldr $cldrRepository | ||
return |
protected array $localizedSymbols | ||
return | array |
protected array $parsedFormats | ||
return | array |
protected array $parsedFormatsIndices | ||
return | array |