kpiroumian    02/04/29 02:32:58

  Modified:    src/documentation/xdocs/userdocs/transformers
                        i18n-transformer.xml
  Log:
  Changes in number formatting attributes
  PR:7726
  Submitted by: Michael Enke ([EMAIL PROTECTED])
  
  Revision  Changes    Path
  1.2       +9 -7      
xml-cocoon2/src/documentation/xdocs/userdocs/transformers/i18n-transformer.xml
  
  Index: i18n-transformer.xml
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/transformers/i18n-transformer.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- i18n-transformer.xml      3 Jan 2002 12:31:06 -0000       1.1
  +++ i18n-transformer.xml      29 Apr 2002 09:32:58 -0000      1.2
  @@ -186,25 +186,27 @@
                                <p>
                                        If no pattern was specified then the date will 
be formatted with the <code>DateFormat.DEFAULT</code> format (both date and time). If 
no value for the date is specified then the current date will be used. E.g.: 
<code><![CDATA[<i18n:date/> ]]></code> will result in the current date, formatted with 
default localized pattern.
                                </p>
  -                             <p>To format numbers in locale sensitive manner use 
<code><![CDATA[<i18n:number pattern="0.##" value="2.0" />]]></code>. This will be 
useful for Arabic, Indian, etc. number formatting. Additionally, currencies and 
percent formatting can be used. E.g.: 
  +                             <p>To format numbers in locale sensitive manner use 
<code><![CDATA[<i18n:number pattern="0.##" value="2.0" />]]></code>. This will be 
useful for Arabic, Indian, etc. number formatting. Additionally, currencies and 
percent formatting can be used, known types are <code>currency</code>, 
<code>currency-no-unit</code>, <code>int-currency</code>, 
<code>int-currency-no-unit</code> and <code>percent</code>. Another useful attribute 
is <code>fraction-digits</code>, E.g.: 
                                </p>
                                        <ul>
  -                                             <li><code><![CDATA[<i18n:number 
sub-type="currency" value="1703.74" />]]></code> will result in localized presentation 
of the <code>value</code> - $1,703.74 for US locale.</li>
  -                                             <li><code><![CDATA[<i18n:number 
sub-type="int-currency" value="170374" />]]></code> will result in localized 
presentation of the <code>value</code> - $1,703.74 for US locale, 170374 for a 
currency without subunit.</li>
  -                                             <li><code><![CDATA[<i18n:number 
sub-type="percent" value="1.2" />]]></code> will result in localized percent 
<code>value</code> - %120 for most of the locales.</li>
  +                                             <li><code><![CDATA[<i18n:number 
type="currency" value="1703.7434" />]]></code> will result in localized presentation 
of the <code>value</code> - $1,703.74 for US locale.</li>
  +                                             <li><code><![CDATA[<i18n:number 
type="currency" fraction-digits="3" value="1703.7434" />]]></code> will result in 
localized presentation of the <code>value</code> - $1,703.743 for US locale so you can 
print gasonline prices.</li>
  +                                             <li><code><![CDATA[<i18n:number 
type="int-currency" value="170374" />]]></code> will result in localized presentation 
of the <code>value</code> - $1,703.74 for US locale, 170374 (with unit) for a currency 
without subunit.</li>
  +                                             <li><code><![CDATA[<i18n:number 
type="int-currency-no-unit" value="170374" />]]></code> will result in localized 
presentation of the <code>value</code> - 1,703.74 for US locale, 170374 (without) for 
a currency without subunit.</li>
  +                                             <li><code><![CDATA[<i18n:number 
type="percent" value="1.2" />]]></code> will result in localized percent 
<code>value</code> - %120 for most of the locales.</li>
                                        </ul>
                                <p>
  -                                     Also, date and number formatting can be used 
with substitution params. Additional <code>type</code> attribute must be used with 
params to indicate the param type (date or number). Default type is 
<code>string</code>.
  +                                     Also, date and number formatting can be used 
with substitution params. <code>type</code> attribute must be used with params to 
indicate the param type (date, number, currency, ...). Default type is 
<code>string</code>.
                                </p>
                                <source><![CDATA[
   <i18n:translate>
     <i18n:text>
       You have to pay {0} for {1} pounds or {2} of your profit. Valid from {3}
     </i18n:text>
  -  <i18n:param type="number" sub-type="currency"
  +  <i18n:param type="currency"
                 pattern="$#,##0.00">102.5</i18n:param>
     <i18n:param type="number" value="2.5">
  -  <i18n:param type="number" sub-type="percent" value="0.10" />       
  +  <i18n:param type="percent" value="0.10" /> 
     <i18n:param type="date" pattern="dd-MMM-yy" />
   </i18n:translate>]]></source>
                                <p>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to