Query: numfmt_get_pattern
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
NUMFMT_GET_PATTERN(3) 1 NUMFMT_GET_PATTERN(3) NumberFormatter::getPattern - Get formatter pattern Object oriented styleSYNOPSISpublic string NumberFormatter::getPattern (void )DESCRIPTIONProcedural style string numfmt_get_pattern (NumberFormatter $fmt) Extract pattern used by the formatter.PARAMETERSo $fmt -NumberFormatter object.RETURN VALUESPattern string that is used by the formatter, or FALSE if an error happens.EXAMPLESExample #1 numfmt_get_pattern(3) example <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".numfmt_get_pattern($fmt)." "; echo numfmt_format($fmt, 1234567.891234567890000)." "; numfmt_set_pattern($fmt, "#0.# kg"); echo "Pattern: ".numfmt_get_pattern($fmt)." "; echo numfmt_format($fmt, 1234567.891234567890000)." "; ?> Example #2 OO example <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); echo "Pattern: ".$fmt->getPattern()." "; echo $fmt->format(1234567.891234567890000)." "; $fmt->setPattern("#0.# kg"); echo "Pattern: ".$fmt->getPattern()." "; echo $fmt->format(1234567.891234567890000)." "; ?> The above example will output: Pattern: #,##0.### 1.234.567,891 Pattern: #0.# kg 1234567,9 kgSEE ALSOnumfmt_get_error_code(3), numfmt_set_pattern(3), numfmt_create(3). PHP Documentation Group NUMFMT_GET_PATTERN(3)
Related Man Pages |
---|
numfmt_get_text_attribute(3) - php |
numfmt_get_error_message(3) - php |
numfmt_get_attribute(3) - php |
numfmt_get_symbol(3) - php |
numfmt_parse(3) - php |
Similar Topics in the Unix Linux Community |
---|
Extract Pattern Sequence |
SED Search Pattern and Replace with the Pattern |
Pattern in a paragraph |
Pattern Match & Extract from a string |
Pattern Search not working properly |