Re: [xsl] Creating a cheque type format using format-number (e.g. $********123.45CR)`

Subject: Re: [xsl] Creating a cheque type format using format-number (e.g. $********123.45CR)`
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 8 Jun 2006 10:06:08 +0100
would be a bit easier in 2.0 but in 1.0

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:variable name="pad" select="'********************'"/>
<xsl:template match="/">

<xsl:variable name="n"><xsl:value-of select="format-number(124456.78, '###,###.00CR')"/></xsl:variable>
$<xsl:value-of select="substring($pad,string-length($n))"/><xsl:value-of select="$n"/>
</xsl:template>

</xsl:stylesheet>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread