NumberFormatter::create()

static NumberFormatter create(string $locale = 'en', int $style = null, string $pattern = null)

Static constructor.

Parameters

string $locale The locale code. The only supported locale is "en" (or null using the default locale, i.e. "en")
int $style Style of the formatting, one of the format style constants The only currently supported styles are NumberFormatter::DECIMAL and NumberFormatter::CURRENCY.
string $pattern Not supported. A pattern string in case $style is NumberFormat::PATTERNDECIMAL or NumberFormat::PATTERNRULEBASED. It must conform to the syntax described in the ICU DecimalFormat or ICU RuleBasedNumberFormat documentation

Return Value

NumberFormatter

Exceptions

MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed
MethodArgumentValueNotImplementedException When the $style is not supported
MethodArgumentNotImplementedException When the pattern value is different than null

See also

http://www.php.net/manual/en/numberformatter.create.php
http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details
http://www.icu-project.org/apiref/icu4c/classRuleBasedNumberFormat.html#_details
doc_Symfony
2016-10-28 06:24:55
Comments
Leave a Comment

Please login to continue.