Zend_Currency-Options.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.currency.options">
  4. <title>Options for currencies</title>
  5. <para>
  6. Depending on your needs, several options can be specified at instantiation. All of this
  7. options have default values. But sometimes it is necessary to define how your currencies
  8. will be rendered. This includes for example:
  9. </para>
  10. <itemizedlist mark='opencircle'>
  11. <listitem>
  12. <para>
  13. <emphasis>Currency symbol, shortname or name</emphasis>:
  14. </para>
  15. <para>
  16. <classname>Zend_Currency</classname> knows all currency names, abbreviations and
  17. signs. But sometimes you could be in need to define the string which has to be
  18. displayed as replacement for a currency.
  19. </para>
  20. </listitem>
  21. <listitem>
  22. <para>
  23. <emphasis>Currency position</emphasis>:
  24. </para>
  25. <para>
  26. The position of the currency symbol is automatically defined. But sometimes you
  27. could be in need to define it manually.
  28. </para>
  29. </listitem>
  30. <listitem>
  31. <para>
  32. <emphasis>Script</emphasis>:
  33. </para>
  34. <para>
  35. You could define the script which shall be used to display digits. Detailed
  36. information about scripts and their usage can be found in
  37. <classname>Zend_Locale</classname>'s chapter <link
  38. linkend="zend.locale.numbersystems">Numeral System Conversion</link>.
  39. </para>
  40. </listitem>
  41. <listitem>
  42. <para>
  43. <emphasis>Number formatting</emphasis>:
  44. </para>
  45. <para>
  46. The amount of currency (generally known as money value) is formatted by
  47. using the formatting rules defined by the locale. For example is the ','
  48. sign in English used as separator for thousands, but in German as precision
  49. sign.
  50. </para>
  51. </listitem>
  52. </itemizedlist>
  53. <para>
  54. The following list mentions all options which could be set. They can either be set at
  55. initiation or by using the <methodname>setFormat()</methodname> method. In any case
  56. you have to give this options as array.
  57. </para>
  58. <itemizedlist mark='opencircle'>
  59. <listitem>
  60. <para>
  61. <emphasis><property>currency</property></emphasis>: Defines the abbreviation
  62. which can be displayed.
  63. </para>
  64. </listitem>
  65. <listitem>
  66. <para>
  67. <emphasis><property>display</property></emphasis>: Defines which part of the
  68. currency should be used for displaying the currency representation. There are 4
  69. representations which can be used and which are all described in <link
  70. linkend="zend.currency.description">this
  71. table</link>.
  72. </para>
  73. </listitem>
  74. <listitem>
  75. <para>
  76. <emphasis><property>format</property></emphasis>: Defines the format which
  77. should be used for displaying numbers. This number-format includes for example
  78. the thousand separator. You can either use a default format by giving a locale
  79. identifier, or define the number-format manually. If no format is set the locale
  80. from the <classname>Zend_Currency</classname> object will be used. See <link
  81. linkend="zend.locale.number.localize.table-1">the chapter about number
  82. formatting</link> for details.
  83. </para>
  84. </listitem>
  85. <listitem>
  86. <para>
  87. <emphasis><property>locale</property></emphasis>: Defines a locale for this
  88. currency. It will be used for detecting the default values when other settings
  89. are omitted. Note that when you don't set a locale yourself, it will be detected
  90. automatically which could lead to problems.
  91. </para>
  92. </listitem>
  93. <listitem>
  94. <para>
  95. <emphasis><property>name</property></emphasis>: Defines the full currency name
  96. which can be displayed.
  97. </para>
  98. </listitem>
  99. <listitem>
  100. <para>
  101. <emphasis><property>position</property></emphasis>: Defines the position at
  102. which the currency description should be displayed. The supported positions are
  103. described <link
  104. linkend="zend.currency.position">this section</link>.
  105. </para>
  106. </listitem>
  107. <listitem>
  108. <para>
  109. <emphasis><property>precision</property></emphasis>: Defines the precision which
  110. should be used for the currency representation. The default value depends on the
  111. locale and is for most locales <emphasis>2</emphasis>.
  112. </para>
  113. </listitem>
  114. <listitem>
  115. <para>
  116. <emphasis><property>script</property></emphasis>: Defined which script should
  117. be used for displaying digits. The default script for most locales is
  118. <emphasis>'Latn'</emphasis>, which includes the digits 0 to 9. Other
  119. scripts such as 'Arab' (Arabian) are using other digits. See <link
  120. linkend="zend.locale.numbersystems">the chapter about numbering
  121. systems</link> for details and available options.
  122. </para>
  123. </listitem>
  124. <listitem>
  125. <para>
  126. <emphasis><property>service</property></emphasis>: Defines the exchange service
  127. which has to be used when calculating with different currencies.
  128. </para>
  129. </listitem>
  130. <listitem>
  131. <para>
  132. <emphasis><property>symbol</property></emphasis>: Defines the currency symbol
  133. which can be displayed.
  134. </para>
  135. </listitem>
  136. <listitem>
  137. <para>
  138. <emphasis><property>value</property></emphasis>: Defines the currency amount
  139. (money value). Using this option you should also set the
  140. <property>service</property> option.
  141. </para>
  142. </listitem>
  143. </itemizedlist>
  144. <para>
  145. As you can see there is much which could be changed. Still as already mentioned the
  146. default values for this settings conform the official standard for currency
  147. representation in every country.
  148. </para>
  149. </sect1>