Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

numfmt_get_locale(3) [php man page]

NUMFMT_GET_LOCALE(3)							 1						      NUMFMT_GET_LOCALE(3)

NumberFormatter::getLocale - Get formatter locale

	Object oriented style

SYNOPSIS
public string NumberFormatter::getLocale ([int $type]) DESCRIPTION
Procedural style string numfmt_get_locale (NumberFormatter $fmt, [int $type]) Get formatter locale name. PARAMETERS
o $fmt -NumberFormatter object. o $type - You can choose between valid and actual locale ( Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE, respectively). The default is the actual locale. RETURN VALUES
The locale name used to create the formatter. EXAMPLES
Example #1 numfmt_get_locale(3) example <?php $req = 'fr_FR_PARIS'; $fmt = numfmt_create( $req, NumberFormatter::DECIMAL); $res_val = numfmt_get_locale( $fmt, Locale::VALID_LOCALE ); $res_act = numfmt_get_locale( $fmt, Locale::ACTUAL_LOCALE ); printf( "Requested locale name: %s Valid locale name: %s Actual locale name: %s ", $req, $res_val, $res_act ); ?> The above example will output: Requested locale name: fr_FR_PARIS Valid locale name: fr_FR Actual locale name: fr SEE ALSO
numfmt_create(3), numfmt_get_error_code(3). PHP Documentation Group NUMFMT_GET_LOCALE(3)

Check Out this Related Man Page

NUMFMT_GET_ERROR_CODE(3)						 1						  NUMFMT_GET_ERROR_CODE(3)

NumberFormatter::getErrorCode - Get formatter's last error code.

	Object oriented style

SYNOPSIS
public int NumberFormatter::getErrorCode (void ) DESCRIPTION
Procedural style int numfmt_get_error_code (NumberFormatter $fmt) Get error code from the last function performed by the formatter. PARAMETERS
o $fmt -NumberFormatter object. RETURN VALUES
Returns error code from last formatter call. EXAMPLES
Example #1 numfmt_get_error_code(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_message(3), intl_get_error_code(3), intl_is_failure(3). PHP Documentation Group NUMFMT_GET_ERROR_CODE(3)
Man Page