reference/intl/numberformatter/format.xml
1976eae0d815797af97a1e16c5cd90ffc2868395
...
...
@@ -12,22 +12,19 @@
12
12
<para>
13
13
&style.oop;
14
14
</para>
15
-
<methodsynopsis>
16
-
<modifier>public</modifier>
17
-
<type>string</type>
18
-
<methodname>NumberFormatter::format</methodname>
19
-
<methodparam><type>number</type><parameter>value</parameter></methodparam>
20
-
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
15
+
<methodsynopsis role="NumberFormatter">
16
+
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>NumberFormatter::format</methodname>
17
+
<methodparam><type class="union"><type>int</type><type>float</type></type><parameter>num</parameter></methodparam>
18
+
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>NumberFormatter::TYPE_DEFAULT</initializer></methodparam>
21
19
</methodsynopsis>
22
20
<para>
23
21
&style.procedural;
24
22
</para>
25
23
<methodsynopsis>
26
-
<type>string</type>
27
-
<methodname>numfmt_format</methodname>
28
-
<methodparam><type>NumberFormatter</type><parameter>fmt</parameter></methodparam>
29
-
<methodparam><type>number</type><parameter>value</parameter></methodparam>
30
-
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
24
+
<type class="union"><type>string</type><type>false</type></type><methodname>numfmt_format</methodname>
25
+
<methodparam><type>NumberFormatter</type><parameter>formatter</parameter></methodparam>
26
+
<methodparam><type class="union"><type>int</type><type>float</type></type><parameter>num</parameter></methodparam>
27
+
<methodparam choice="opt"><type>int</type><parameter>type</parameter><initializer>NumberFormatter::TYPE_DEFAULT</initializer></methodparam>
31
28
</methodsynopsis>
32
29
<para>
33
30
Format a numeric value according to the formatter rules.
...
...
@@ -39,7 +36,7 @@
39
36
<para>
40
37
<variablelist>
41
38
<varlistentry>
42
-
<term><parameter>fmt</parameter></term>
39
+
<term><parameter>formatter</parameter></term>
43
40
<listitem>
44
41
<para>
45
42
<classname>NumberFormatter</classname> object.
...
...
@@ -47,10 +44,10 @@
47
44
</listitem>
48
45
</varlistentry>
49
46
<varlistentry>
50
-
<term><parameter>value</parameter></term>
47
+
<term><parameter>num</parameter></term>
51
48
<listitem>
52
49
<para>
53
-
The value to format. Can be <type>integer</type> or <type>float</type>,
50
+
The value to format. Can be <type>int</type> or <type>float</type>,
54
51
other values will be converted to a numeric value.
55
52
</para>
56
53
</listitem>
...
...
@@ -62,6 +59,8 @@
62
59
The
63
60
<link linkend="intl.numberformatter-constants.types">
64
61
formatting type</link> to use.
62
+
Note that <constant>NumberFormatter::TYPE_CURRENCY</constant> is not supported;
63
+
use <methodname>NumberFormatter::formatCurrency</methodname> instead.
65
64
</para>
66
65
</listitem>
67
66
</varlistentry>
...
...
@@ -115,6 +114,19 @@ if(intl_is_failure($fmt->getErrorCode())) {
115
114
</screen>
116
115
</refsect1>
117
116

117
+
<refsect1 role="notes">
118
+
&reftitle.notes;
119
+
<note>
120
+
<para>
121
+
Formats achievable by this method of formatting cannot fully use the possibilities of underlying ICU library,
122
+
such as to format currency with narrow currency symbol.
123
+
</para>
124
+
<para>
125
+
To fully utilize them use <function>msgfmt_format_message</function>.
126
+
</para>
127
+
</note>
128
+
</refsect1>
129
+

118
130
<refsect1 role="seealso">
119
131
&reftitle.seealso;
120
132
<para>
...
...
@@ -122,11 +134,11 @@ if(intl_is_failure($fmt->getErrorCode())) {
122
134
<member><function>numfmt_get_error_code</function></member>
123
135
<member><function>numfmt_format_currency</function></member>
124
136
<member><function>numfmt_parse</function></member>
137
+
<member><function>msgfmt_format_message</function></member>
125
138
</simplelist>
126
139
</para>
127
140
</refsect1>
128
141
</refentry>
129
-

130
142
<!-- Keep this comment at the end of the file
131
143
Local variables:
132
144
mode: sgml
133
145