downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

NumberFormatter::getSymbol> <NumberFormatter::getLocale
[edit] Last updated: Wed, 19 Jun 2013

view this page in

NumberFormatter::getPattern

numfmt_get_pattern

(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)

NumberFormatter::getPattern -- numfmt_get_patternObtener el patrón del formateador

Descripción

Estilo orientado a objetos

string NumberFormatter::getPattern ( void )

Estilo por procedimientos

string numfmt_get_pattern ( NumberFormatter $fmt )

Extrae el patrón usado por el formateador.

Parámetros

fmt

Un objeto de la clase NumberFormatter.

Valores devueltos

El string con el patroón que es usado por el formateador, o FALSE en caso de error.

Ejemplos

Ejemplo #1 Ejemplo de numfmt_get_pattern()

<?php
$fmt 
numfmt_create'de_DE'NumberFormatter::DECIMAL );
echo 
"Patrón: ".numfmt_get_pattern($fmt)."\n";
echo 
numfmt_format($fmt1234567.891234567890000)."\n";
numfmt_set_pattern($fmt"#0.# kg");
echo 
"Patrón: ".numfmt_get_pattern($fmt)."\n";
echo 
numfmt_format($fmt1234567.891234567890000)."\n";
?>

Ejemplo #2 OO example

<?php
$fmt 
= new NumberFormatter'de_DE'NumberFormatter::DECIMAL );
echo 
"Patrón: ".$fmt->getPattern()."\n";
echo 
$fmt->format(1234567.891234567890000)."\n";
$fmt->setPattern("#0.# kg");
echo 
"Patrón: ".$fmt->getPattern()."\n";
echo 
$fmt->format(1234567.891234567890000)."\n";
?>

El resultado del ejemplo sería:

Patrón: #,##0.###
1.234.567,891
Patrón: #0.# kg
1234567,9 kg

Ver también



add a note add a note User Contributed Notes NumberFormatter::getPattern - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites