Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: wrong number format

From: "joost" <noreple@----.-->
To: NULL
Date: 12/9/2007 10:38:00 PM

thanks for the help.
I will try it out
joost

"Martin Honnen" <mahotrash@y...> schreef in bericht 
news:eFlED9lOIHA.4912@T......
> joost wrote:
>> Hello i have the following problem.
>> I have a xml file where value 44.24688969 is in.
>> I want to be the format 22,24 therefore i use in dreamweaver the 
>> format-number(value,'#,##.00') see codes.
>
> I don't understand why "44.24688969" should be formatted as "22,24".
>
>> When testing it i got the number 44.24188969 in the browser.
>>
>> Can anyone solve my problem to get the result to 44.24
>
> Now you say "44.24" which is quite different from "22,24".
>
> Assuming you want 44.24 then the following should help:
>
>
> <xsl:stylesheet
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   version="1.0">
>
>   <xsl:output method="html" indent="yes"/>
>
>   <xsl:template match="/">
>     <html lang="en">
>       <head>
>         <title>Example</title>
>       </head>
>       <body>
>         <xsl:apply-templates select="test"/>
>       </body>
>     </html>
>   </xsl:template>
>
>   <xsl:template match="test">
>     <table>
>       <tbody>
>         <xsl:apply-templates select="record"/>
>       </tbody>
>     </table>
>   </xsl:template>
>
>   <xsl:template match="record">
>     <tr>
>       <xsl:apply-templates select="value"/>
>     </tr>
>   </xsl:template>
>
>   <xsl:template match="value">
>     <td align="right"><xsl:value-of select="format-number(., 
> '#,###.00')"/></td>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> Works fine for me with IE 6, Firefox 2.0, Opera 9.
>
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent