xsl-list
[Top] [All Lists]

RE: format number with changeable currency symbol

2004-06-18 02:29:47
XSLT 1.0 explicitly doesn't allow the currency symbol, though some
implementations may let you get away with it (XSLT 1.0 specified
format-number() in terms of the JDK 1.1 specifications, but implementations
using a newer release of Java may "accidentally" expose facilities
introduced in later JDK versions.)

I would avoid trying to do this with format-number(), and do it "by hand".

Michael Kay 

-----Original Message-----
From: James Steven [mailto:JSteven(_at_)redlinesoftware(_dot_)co(_dot_)uk] 
Sent: 18 June 2004 09:33
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] format number with changeable currency symbol

Hello
I would like to format a number so that it can be shown with 
any type of
currency symbol in front of it.  Currently I am using eg. 
<xsl:value-of
select="format-number(12345, '?###,###,##0.00')"/> but this 
only formats the
number with a ?.

Also I have tried putting a currency symbol element in the 
xml and including
that in the xsl to be inserted before the number.  The 
trouble with this
method is that if the figure is a negative number the minus 
sign is inserted
after the currency symbol which is no good.  Is there a way that the
format-number function can be used with a currency symbol 
element from the
xml so that the currency symbol can be changed in the xml?  
Or is there any
other way to solve this?

Thanks for your help.
James





--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>