<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.numberformatter" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
 <title>The NumberFormatter class</title>
 <titleabbrev>NumberFormatter</titleabbrev>

 <partintro>

  <!-- {{{ NumberFormatter intro -->
  <section xml:id="numberformatter.intro">
   &reftitle.intro;
   <simpara>
    Programs store and operate on numbers using a locale-independent binary
    representation. When displaying or printing a number it is converted to a
    locale-specific string. For example, the number 12345.67 is "12,345.67" in
    the US, "12 345,67" in France and "12.345,67" in Germany.
   </simpara>
   <simpara>
    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.
   </simpara>
   <para>
    For currencies you can use currency format type to create a formatter that
    returns a string with the formatted number and the appropriate currency
    sign. Of course, the NumberFormatter class is unaware of exchange rates
    so, the number output is the same regardless of the specified currency.
    This means that the same number has different monetary values depending on
    the currency locale. If the number is 9988776.65 the results will be:
    <simplelist>
     <member>9 988 776,65 € in France</member>
     <member>9.988.776,65 € in Germany</member>
     <member>$9,988,776.65 in the United States</member>
    </simplelist>
   </para>
   <simpara>
    In order to format percentages, create a locale-specific formatter with
    percentage format type. With this formatter, a decimal fraction such as
    0.75 is displayed as 75%.
   </simpara>
   <simpara>
    For more complex formatting, like spelled-out numbers, the rule-based
    number formatters are used.
   </simpara>
  </section>
  <!-- }}} -->

  <section xml:id="numberformatter.synopsis">
   &reftitle.classsynopsis;

   <!-- {{{ Synopsis -->
   <classsynopsis class="class">
    <ooclass>
     <classname>NumberFormatter</classname>
    </ooclass>

    <classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pattern-decimal">NumberFormatter::PATTERN_DECIMAL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.decimal">NumberFormatter::DECIMAL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.currency">NumberFormatter::CURRENCY</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.percent">NumberFormatter::PERCENT</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.scientific">NumberFormatter::SCIENTIFIC</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.spellout">NumberFormatter::SPELLOUT</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.ordinal">NumberFormatter::ORDINAL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.duration">NumberFormatter::DURATION</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pattern-rulebased">NumberFormatter::PATTERN_RULEBASED</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.ignore">NumberFormatter::IGNORE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.currency-accounting">NumberFormatter::CURRENCY_ACCOUNTING</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.default-style">NumberFormatter::DEFAULT_STYLE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-ceiling">NumberFormatter::ROUND_CEILING</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-floor">NumberFormatter::ROUND_FLOOR</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-down">NumberFormatter::ROUND_DOWN</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-up">NumberFormatter::ROUND_UP</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-halfeven">NumberFormatter::ROUND_HALFEVEN</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-halfdown">NumberFormatter::ROUND_HALFDOWN</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.round-halfup">NumberFormatter::ROUND_HALFUP</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pad-before-prefix">NumberFormatter::PAD_BEFORE_PREFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pad-after-prefix">NumberFormatter::PAD_AFTER_PREFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pad-before-suffix">NumberFormatter::PAD_BEFORE_SUFFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pad-after-suffix">NumberFormatter::PAD_AFTER_SUFFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.parse-int-only">NumberFormatter::PARSE_INT_ONLY</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.grouping-used">NumberFormatter::GROUPING_USED</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.decimal-always-shown">NumberFormatter::DECIMAL_ALWAYS_SHOWN</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.max-integer-digits">NumberFormatter::MAX_INTEGER_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.min-integer-digits">NumberFormatter::MIN_INTEGER_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.integer-digits">NumberFormatter::INTEGER_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.max-fraction-digits">NumberFormatter::MAX_FRACTION_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.min-fraction-digits">NumberFormatter::MIN_FRACTION_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.fraction-digits">NumberFormatter::FRACTION_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.multiplier">NumberFormatter::MULTIPLIER</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.grouping-size">NumberFormatter::GROUPING_SIZE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.rounding-mode">NumberFormatter::ROUNDING_MODE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.rounding-increment">NumberFormatter::ROUNDING_INCREMENT</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.format-width">NumberFormatter::FORMAT_WIDTH</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.padding-position">NumberFormatter::PADDING_POSITION</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.secondary-grouping-size">NumberFormatter::SECONDARY_GROUPING_SIZE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.significant-digits-used">NumberFormatter::SIGNIFICANT_DIGITS_USED</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.min-significant-digits">NumberFormatter::MIN_SIGNIFICANT_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.max-significant-digits">NumberFormatter::MAX_SIGNIFICANT_DIGITS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.lenient-parse">NumberFormatter::LENIENT_PARSE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.positive-prefix">NumberFormatter::POSITIVE_PREFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.positive-suffix">NumberFormatter::POSITIVE_SUFFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.negative-prefix">NumberFormatter::NEGATIVE_PREFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.negative-suffix">NumberFormatter::NEGATIVE_SUFFIX</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.padding-character">NumberFormatter::PADDING_CHARACTER</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.currency-code">NumberFormatter::CURRENCY_CODE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.default-ruleset">NumberFormatter::DEFAULT_RULESET</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.public-rulesets">NumberFormatter::PUBLIC_RULESETS</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.decimal-separator-symbol">NumberFormatter::DECIMAL_SEPARATOR_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.grouping-separator-symbol">NumberFormatter::GROUPING_SEPARATOR_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pattern-separator-symbol">NumberFormatter::PATTERN_SEPARATOR_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.percent-symbol">NumberFormatter::PERCENT_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.zero-digit-symbol">NumberFormatter::ZERO_DIGIT_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.digit-symbol">NumberFormatter::DIGIT_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.minus-sign-symbol">NumberFormatter::MINUS_SIGN_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.plus-sign-symbol">NumberFormatter::PLUS_SIGN_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.currency-symbol">NumberFormatter::CURRENCY_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.intl-currency-symbol">NumberFormatter::INTL_CURRENCY_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.monetary-separator-symbol">NumberFormatter::MONETARY_SEPARATOR_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.exponential-symbol">NumberFormatter::EXPONENTIAL_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.permill-symbol">NumberFormatter::PERMILL_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.pad-escape-symbol">NumberFormatter::PAD_ESCAPE_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.infinity-symbol">NumberFormatter::INFINITY_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.nan-symbol">NumberFormatter::NAN_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.significant-digit-symbol">NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.monetary-grouping-separator-symbol">NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.type-default">NumberFormatter::TYPE_DEFAULT</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.type-int32">NumberFormatter::TYPE_INT32</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.type-int64">NumberFormatter::TYPE_INT64</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.type-double">NumberFormatter::TYPE_DOUBLE</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>const</modifier>
     <type>int</type>
     <varname linkend="numberformatter.constants.type-currency">NumberFormatter::TYPE_CURRENCY</varname>
    </fieldsynopsis>

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.numberformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='NumberFormatter'])">
     <xi:fallback/>
    </xi:include>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.numberformatter')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='NumberFormatter'])">
     <xi:fallback/>
    </xi:include>
   </classsynopsis>
   <!-- }}} -->

  </section>

  <!-- {{{ NumberFormatter properties
   <section xml:id="numberformatter.props">
   &reftitle.properties;
   <variablelist>
   <varlistentry xml:id="numberformatter.props.name">
   <term><varname>name</varname></term>
   <listitem>
   <para>Prop description</para>
   </listitem>
   </varlistentry>
   </variablelist>
   </section>
   }}} -->

  &reference.intl.numberformatter-constants;

  <section xml:id="numberformatter.seealso">
   &reftitle.seealso;
   <para>
    <simplelist>
     <member>
      <link xlink:href="&url.icu.formatparse;">
       ICU formatting documentation
      </link>
     </member>
     <member>
      <link xlink:href="&url.icu.formatnumbers;">ICU number formatters</link>
     </member>
     <member>
      <link xlink:href="&url.icu.decimalformat;">ICU decimal formatters</link>
     </member>
     <member>
      <link xlink:href="&url.icu.ruleformat;">
       ICU rule-based number formatters
      </link>
     </member>
    </simplelist>
   </para>
  </section>
 </partintro>

 &reference.intl.entities.numberformatter;

</phpdoc:classref>
<!-- Keep this comment at the end of the file
 Local variables:
 mode: sgml
 sgml-omittag:t
 sgml-shorttag:t
 sgml-minimize-attributes:nil
 sgml-always-quote-attributes:t
 sgml-indent-step:1
 sgml-indent-data:t
 indent-tabs-mode:nil
 sgml-parent-document:nil
 sgml-default-dtd-file:"~/.phpdoc/manual.ced"
 sgml-exposed-tags:nil
 sgml-local-catalogs:nil
 sgml-local-ecat-files:nil
 End:
 vim600: syn=xml fen fdm=syntax fdl=2 si
 vim: et tw=78 syn=sgml
 vi: ts=1 sw=1
-->
