cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: Woody convertors: date formatting & decimal formatting
Date Mon, 26 Jul 2004 11:54:17 GMT
How to remove the "," from the integer formatting:

When I use:

    <wd:datatype base="integer">
        <wd:convertor type="formatting" variant="integer">
          <wd:patterns>
            <wd:pattern>#0</wd:pattern>
          </wd:patterns>
        </wd:convertor>
    </wd:datatype>

I get 1,677 instead of 1677 ?

Thanks
Derek

>>> bruno@outerthought.org 2004/07/26 01:05:25 PM >>>
On Mon, 2004-07-26 at 12:08, Gunter D'Hondt wrote:
> 1) date formatting:
> 
> In my form definition I've got the following:
> 
>   <wd:output id="mydate">
>     <wd:datatype base="date"/>
>     <wd:label/>
>     <wd:convertor type="formatting">
>       <wd:patterns>
>         <wd:pattern>dd-MM-yyyy</wd:pattern>
>       </wd:patterns>
>     </wd:convertor>
>   </wd:output>        
> 
> The input from the binding is "1900-01-01 00:00:00" but the outcome
> (in the browser) is always: 1/1/00
> 
> 2) decimal formatting:
> 
> Same for a decimal:
> 
>   <wd:field id="mydecimal">
>     <wd:datatype base="decimal"/>
>     <wd:label/>
>         <wd:convertor type="formatting" variant="integer">
>           <wd:patterns>
>             <wd:pattern>#0</wd:pattern>
>           </wd:patterns>
>         </wd:convertor>
>   </wd:field>
> 
> Input is: 1000.0 and outcome is again 1000.0 instead of 1000.
> 
> Any help is welcome,

The convertor elements should be moved into the datatype elements:

    <wd:datatype base="decimal">
        <wd:convertor type="formatting" variant="integer">
          <wd:patterns>
            <wd:pattern>#0</wd:pattern>
          </wd:patterns>
        </wd:convertor>
    </wd:datatype>

-- 
Bruno Dumon                             http://outerthought.org/ 
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
For additional commands, e-mail: users-help@cocoon.apache.org 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message