1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.currency.position">
4 <title>Where is the currency?</title>
7 The position where the currency sign or name will be displayed depends on the locale.
8 Still, when you want to define this setting yourself you have to use the
9 <property>display</property> option and provide one of the following constants:
12 <table id="zend.currency.position.table-1">
13 <title>Available positions for the currency</title>
15 <tgroup cols="2" align="left">
18 <entry>Constant</entry>
19 <entry>Description</entry>
25 <entry><constant>STANDARD</constant></entry>
26 <entry>Sets the standard position as defined within the locale</entry>
30 <entry><constant>RIGHT</constant></entry>
33 Displays the currency representation at the right side of the value
38 <entry><constant>LEFT</constant></entry>
41 Displays the currency representation at the left side of the value
48 <example id="zend.currency.position.example-1">
49 <title>Setting the currency position</title>
52 Let's assume that your client has again set "en_US" as locale. Using no option the
53 returned value could look like this:
56 <programlisting language="php"><![CDATA[
57 $currency = new Zend_Currency(
63 print $currency; // Could return '$ 100'
67 So by using the default setting the currency (in our case $) could either be
68 rendered left or right from the value. Now let's define a fixed position:
71 <programlisting language="php"><![CDATA[
72 $currency = new Zend_Currency(
75 'position' => Zend_Currency::RIGHT,
79 print $currency; // Could return '100 $';
83 Note that in the second snippet the position of <acronym>USD</acronym> is fixed
84 regardless of the used locale or currency.