NumberFormatter::setPatternnumfmt_set_patternSet formatter pattern
&reftitle.description;
Object oriented style
boolNumberFormatter::setPatternstringpattern
Procedural style
boolnumfmt_set_patternNumberFormatterfmtstringpattern
Set the pattern used by the formatter. Can not be used on a rule-based
formatter.
&reftitle.parameters;
fmtNumberFormatter object.
pattern
Pattern in syntax described in
ICU DecimalFormat
documentation.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
numfmt_set_pattern example
]]>
OO example
getPattern()."\n";
echo $fmt->format(1234567.891234567890000)."\n";
$fmt->setPattern("#0.# kg");
echo "Pattern: ".$fmt->getPattern()."\n";
echo $fmt->format(1234567.891234567890000)."\n";
?>
]]>
&example.outputs;
&reftitle.seealso;
numfmt_get_error_codenumfmt_createnumfmt_get_pattern