Search Results
Parameters ¶ formatter NumberFormatter object. pattern Pattern in syntax described in » ICU DecimalFormat documentation.
Programmation de sites internet en PHP, Ajax et avec la librairie jQuery. Développement de sites web dynamiques avec Wordpress, PrestaShop ou un CMS maison.
Simple usage example of `NumberFormatter::setPattern ()`. The NumberFormatter::setPattern function is a method in PHP that allows you to set a custom formatting pattern for numeric values. This function is particularly useful when you need to format numbers according to a specific pattern or style, such as currency formatting or decimal precision.
Mar 15, 2026 · By invoking the methods provided by the NumberFormatter class, you can format numbers, currencies, and percentages according to the specified or default locale. NumberFormatter is locale-sensitive so you need to create a new NumberFormatter for each locale. NumberFormatter methods format primitive-type numbers, such as double and output the number as a locale-specific string.
Set the pattern used by the formatter. Can not be used on a rule-based formatter.
PHP Manual Function Reference Human Language and Character Encoding Support intl NumberFormatter NumberFormatter::setPattern NumberFormatter::setAttribute NumberFormatter::setSymbol
By invoking the methods provided by the NumberFormatter class, you can format numbers, currencies, and percentages according to the specified or default locale. NumberFormatter is locale-sensitive so you need to create a new NumberFormatter for each locale. NumberFormatter methods format primitive-type numbers, such as double and output the number as a locale-specific string.
