class NumberFormatter
Replacement for PHP's native {@link \NumberFormatter} class.
The only methods currently supported in this class are:
| PATTERN_DECIMAL | |
| DECIMAL | |
| CURRENCY | |
| PERCENT | |
| SCIENTIFIC | |
| SPELLOUT | |
| ORDINAL | |
| DURATION | |
| PATTERN_RULEBASED | |
| IGNORE | |
| DEFAULT_STYLE | |
| TYPE_DEFAULT | |
| TYPE_INT32 | |
| TYPE_INT64 | |
| TYPE_DOUBLE | |
| TYPE_CURRENCY | |
| PARSE_INT_ONLY | |
| GROUPING_USED | |
| DECIMAL_ALWAYS_SHOWN | |
| MAX_INTEGER_DIGITS | |
| MIN_INTEGER_DIGITS | |
| INTEGER_DIGITS | |
| MAX_FRACTION_DIGITS | |
| MIN_FRACTION_DIGITS | |
| FRACTION_DIGITS | |
| MULTIPLIER | |
| GROUPING_SIZE | |
| ROUNDING_MODE | |
| ROUNDING_INCREMENT | |
| FORMAT_WIDTH | |
| PADDING_POSITION | |
| SECONDARY_GROUPING_SIZE | |
| SIGNIFICANT_DIGITS_USED | |
| MIN_SIGNIFICANT_DIGITS | |
| MAX_SIGNIFICANT_DIGITS | |
| LENIENT_PARSE | |
| POSITIVE_PREFIX | |
| POSITIVE_SUFFIX | |
| NEGATIVE_PREFIX | |
| NEGATIVE_SUFFIX | |
| PADDING_CHARACTER | |
| CURRENCY_CODE | |
| DEFAULT_RULESET | |
| PUBLIC_RULESETS | |
| DECIMAL_SEPARATOR_SYMBOL | |
| GROUPING_SEPARATOR_SYMBOL | |
| PATTERN_SEPARATOR_SYMBOL | |
| PERCENT_SYMBOL | |
| ZERO_DIGIT_SYMBOL | |
| DIGIT_SYMBOL | |
| MINUS_SIGN_SYMBOL | |
| PLUS_SIGN_SYMBOL | |
| CURRENCY_SYMBOL | |
| INTL_CURRENCY_SYMBOL | |
| MONETARY_SEPARATOR_SYMBOL | |
| EXPONENTIAL_SYMBOL | |
| PERMILL_SYMBOL | |
| PAD_ESCAPE_SYMBOL | |
| INFINITY_SYMBOL | |
| NAN_SYMBOL | |
| SIGNIFICANT_DIGIT_SYMBOL | |
| MONETARY_GROUPING_SEPARATOR_SYMBOL | |
| ROUND_CEILING | |
| ROUND_FLOOR | |
| ROUND_DOWN | |
| ROUND_UP | |
| ROUND_HALFEVEN | |
| ROUND_HALFDOWN | |
| ROUND_HALFUP | |
| PAD_BEFORE_PREFIX | |
| PAD_AFTER_PREFIX | |
| PAD_BEFORE_SUFFIX | |
| PAD_AFTER_SUFFIX |
| __construct(string $locale = 'en', int $style = null, string $pattern = null) Constructor. | ||
| static NumberFormatter | create(string $locale = 'en', int $style = null, string $pattern = null) Static constructor. | |
| string | formatCurrency(float $value, string $currency) Format a currency value | |
| bool|string | format(number $value, int $type = self::TYPE_DEFAULT) Format a number | |
| bool|int | getAttribute(int $attr) Returns an attribute value | |
| int | getErrorCode() Returns formatter's last error code. | |
| string | getErrorMessage() Returns formatter's last error message. | |
| string | getLocale(int $type = Locale::ACTUAL_LOCALE) Returns the formatter's locale | |
| bool|string | getPattern() Not supported. | |
| bool|string | getSymbol(int $attr) Not supported. | |
| bool|string | getTextAttribute(int $attr) Not supported. | |
| bool|string | parseCurrency(string $value, string $currency, int $position = null) Not supported. | |
| bool|string | parse(string $value, int $type = self::TYPE_DOUBLE, int $position) Parse a number | |
| bool | setAttribute(int $attr, int $value) Set an attribute | |
| bool | setPattern(string $pattern) Not supported. | |
| bool | setSymbol(int $attr, string $value) Not supported. | |
| bool | setTextAttribute(int $attr, int $value) Not supported. |
Constructor.
Static constructor.
Format a currency value
Format a number
Returns an attribute value
Returns formatter's last error code.
Always returns the UZEROERROR class constant value
Returns formatter's last error message.
Always returns the UZEROERROR_MESSAGE class constant value
Returns the formatter's locale
The parameter $type is currently ignored.
Not supported.
Returns the formatter's pattern
Not supported.
Returns a formatter symbol value
Not supported.
Returns a formatter text attribute value
Not supported.
Parse a currency number
Parse a number
Set an attribute
Not supported.
Set the formatter's pattern
Not supported.
Set the formatter's symbol
Not supported.
Set a text attribute
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Intl/NumberFormatter/NumberFormatter.html