Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

numfmt_get_error_message(3) [php man page]

NUMFMT_GET_ERROR_MESSAGE(3)						 1					       NUMFMT_GET_ERROR_MESSAGE(3)

NumberFormatter::getErrorMessage - Get formatter's last error message.

	Object oriented style

SYNOPSIS
public string NumberFormatter::getErrorMessage (void ) DESCRIPTION
Procedural style string numfmt_get_error_message (NumberFormatter $fmt) Get error message from the last function performed by the formatter. PARAMETERS
o $fmt -NumberFormatter object. RETURN VALUES
Returns error message from last formatter call. EXAMPLES
Example #1 numfmt_get_error_message(3) example <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $data = numfmt_format($fmt, 1234567.891234567890000); if(intl_is_failure(numfmt_get_error_code($fmt))) { report_error("Formatter error"); } ?> Example #2 OO example <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $fmt->format(1234567.891234567890000); if(intl_is_failure($fmt->getErrorCode())) { report_error("Formatter error"); } ?> SEE ALSO
numfmt_get_error_code(3), intl_get_error_code(3), intl_is_failure(3). PHP Documentation Group NUMFMT_GET_ERROR_MESSAGE(3)

Check Out this Related Man Page

NUMFMT_GET_PATTERN(3)							 1						     NUMFMT_GET_PATTERN(3)

NumberFormatter::getPattern - Get formatter pattern

	Object oriented style

SYNOPSIS
public string NumberFormatter::getPattern (void ) DESCRIPTION
Procedural style string numfmt_get_pattern (NumberFormatter $fmt) Extract pattern used by the formatter. PARAMETERS
o $fmt -NumberFormatter object. RETURN VALUES
Pattern string that is used by the formatter, or FALSE if an error happens. EXAMPLES
Example #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 kg SEE ALSO
numfmt_get_error_code(3), numfmt_set_pattern(3), numfmt_create(3). PHP Documentation Group NUMFMT_GET_PATTERN(3)
Man Page