1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.currency.options">
4 <title>Options for currencies</title>
7 Depending on your needs, several options can be specified at instantiation. All of this
8 options have default values. But sometimes it is necessary to define how your currencies
9 will be rendered. This includes for example:
12 <itemizedlist mark='opencircle'>
15 <emphasis>Currency symbol, shortname or name</emphasis>:
19 <classname>Zend_Currency</classname> knows all currency names, abbreviations and
20 signs. But sometimes you could be in need to define the string which has to be
21 displayed as replacement for a currency.
27 <emphasis>Currency position</emphasis>:
31 The position of the currency symbol is automatically defined. But sometimes you
32 could be in need to define it manually.
38 <emphasis>Script</emphasis>:
42 You could define the script which shall be used to display digits. Detailed
43 information about scripts and their usage can be found in
44 <classname>Zend_Locale</classname>'s chapter <link
45 linkend="zend.locale.numbersystems">Numeral System Conversion</link>.
51 <emphasis>Number formatting</emphasis>:
55 The amount of currency (generally known as money value) is formatted by
56 using the formatting rules defined by the locale. For example is the ','
57 sign in English used as separator for thousands, but in German as precision
64 The following list mentions all options which could be set. They can either be set at
65 initiation or by using the <methodname>setFormat()</methodname> method. In any case
66 you have to give this options as array.
69 <itemizedlist mark='opencircle'>
72 <emphasis><property>currency</property></emphasis>: Defines the abbreviation
73 which can be displayed.
79 <emphasis><property>display</property></emphasis>: Defines which part of the
80 currency should be used for displaying the currency representation. There are 4
81 representations which can be used and which are all described in <link
82 linkend="zend.currency.description">this
89 <emphasis><property>format</property></emphasis>: Defines the format which
90 should be used for displaying numbers. This number-format includes for example
91 the thousand separator. You can either use a default format by giving a locale
92 identifier, or define the number-format manually. If no format is set the locale
93 from the <classname>Zend_Currency</classname> object will be used. See <link
94 linkend="zend.locale.number.localize.table-1">the chapter about number
95 formatting</link> for details.
101 <emphasis><property>locale</property></emphasis>: Defines a locale for this
102 currency. It will be used for detecting the default values when other settings
103 are omitted. Note that when you don't set a locale yourself, it will be detected
104 automatically which could lead to problems.
110 <emphasis><property>name</property></emphasis>: Defines the full currency name
111 which can be displayed.
117 <emphasis><property>position</property></emphasis>: Defines the position at
118 which the currency description should be displayed. The supported positions are
120 linkend="zend.currency.position">this section</link>.
126 <emphasis><property>precision</property></emphasis>: Defines the precision which
127 should be used for the currency representation. The default value depends on the
128 locale and is for most locales <emphasis>2</emphasis>.
134 <emphasis><property>script</property></emphasis>: Defined which script should
135 be used for displaying digits. The default script for most locales is
136 <emphasis>'Latn'</emphasis>, which includes the digits 0 to 9. Other
137 scripts such as 'Arab' (Arabian) are using other digits. See <link
138 linkend="zend.locale.numbersystems">the chapter about numbering
139 systems</link> for details and available options.
145 <emphasis><property>service</property></emphasis>: Defines the exchange service
146 which has to be used when calculating with different currencies.
152 <emphasis><property>symbol</property></emphasis>: Defines the currency symbol
153 which can be displayed.
159 <emphasis><property>value</property></emphasis>: Defines the currency amount
160 (money value). Using this option you should also set the
161 <property>service</property> option.
167 As you can see there is much which could be changed. Still as already mentioned the
168 default values for this settings conform the official standard for currency
169 representation in every country.