cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten van den Dungen <maar...@shortcut.nl>
Subject What's in a point. Problems with decimal points etc.
Date Fri, 27 Oct 2000 11:28:17 GMT
Dear all,

How can I change the decimal notation in the xslt processor? Right now it 
seems to use a comma as a decimal separator and a point as a grouping 
separator. How can I reverse this? All data have points as decimal 
separators. (see below) Apart from this there seem to be a number of 
irregularities (at least I cannot make sense of it).


<xsl:variable name="var">1.23</xsl:variable>
<xsl:value-of select="$var"/><br/>

Correct: displays 1.23

<xsl:value-of select="$var * 2"/><br/>
<xsl:value-of select="$var * 2.0"/><br/>

Incorrect: both display 246


<xsl:value-of select="1.23 * 2"/><br/>

Correct: displays 2.46


<xsl:value-of select="1,23"/><br/>
<xsl:value-of select="1,23 * 2"/><br/>

Produce a parsing error!

<xsl:variable name="var2">12,345</xsl:variable>
<xsl:value-of select="$var2 * 2"/><br/>

<xsl:variable name="var3">1.234,56</xsl:variable>
<xsl:value-of select="$var3 * 2"/><br/>

Both display the correct result: 24.69 and 2469.12

Does anybody have similar experiences or what am I doing wrong. In my 
application all database supplied data is in decimal point notation. I 
could convert this, but I'd like to make sure I understand the process.
Thanks.

Regards

-----------------------------------------------------
http://www.shortcut.nl/
mailto:hello@shortcut.nl
-----------------------------------------------------
Shortcut Software Development BV
Julianaweg 9
3603 AP Maarssen
The Netherlands
Phone: ++31 (0) 346 579 659
Fax: ++31 (0) 346 579 745
-----------------------------------------------------


Mime
View raw message