Query: numfmt_create
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
NUMFMT_CREATE(3) 1 NUMFMT_CREATE(3) NumberFormatter::create - Create a number formatter Object oriented style (method)SYNOPSISpublicstatic NumberFormatter NumberFormatter::create (string $locale, int $style, [string $pattern])DESCRIPTIONProcedural style NumberFormatter numfmt_create (string $locale, int $style, [string $pattern]) Object oriented style (constructor): NumberFormatter::__construct (string $locale, int $style, [string $pattern]) Creates a number formatter.PARAMETERSo $locale - Locale in which the number would be formatted (locale name, e.g. en_CA). o $style - Style of the formatting, one of the format style constants. If NumberFormatter::PATTERN_DECIMAL or NumberFormatter::PAT- TERN_RULEBASED is passed then the number format is opened using the given pattern, which must conform to the syntax described in ICU DecimalFormat documentation or ICU RuleBasedNumberFormat documentation, respectively. o $pattern - Pattern string if the chosen style requires a pattern.RETURN VALUESReturns NumberFormatter object or FALSE on error.EXAMPLESExample #1 numfmt_create(3) example <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo numfmt_format($fmt, 1234567.891234567890000)." "; $fmt = numfmt_create( 'it', NumberFormatter::SPELLOUT ); echo numfmt_format($fmt, 1142)." "; ?> Example #2 numfmt_create(3) example <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo $fmt->format(1234567.891234567890000)." "; $fmt = new NumberFormatter( 'it', NumberFormatter::SPELLOUT ); echo $fmt->format(1142)." "; ?> The above example will output: 1.234.567,891 millicentoquarantadueSEE ALSOnumfmt_format(3), numfmt_parse(3). PHP Documentation Group NUMFMT_CREATE(3)
Related Man Pages |
---|
datefmt_get_locale(3) - php |
datefmt_get_pattern(3) - php |
datefmt_set_pattern(3) - php |
numfmt_set_symbol(3) - php |
numfmt_set_text_attribute(3) - php |
Similar Topics in the Unix Linux Community |
---|
bash pattern matching echo *[! '/' ] doesn't work |
Awk Command help |
error- multiplying negative decimal values |
addition of decimal no |