Re: [xsl] format-number troubles

Subject: Re: [xsl] format-number troubles
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 20 Sep 2011 09:44:34 +0100
> 0501 needs to become 050100

The string padding technique is to have a string of the padding
characters that is the length of the max number of characters you want
to pad to, then get the substring of it using the length of the string
you are padding:

<xsl:variable name="str" select="'0501'"/>
<xsl:value-of select="concat($str, substring('000000',
string-length($str) + 1))"/>

If you think about it, format-number would be no good here, because
you aren't formatting a number, you are changing it from 501 to 50100.

-- 
Andrew Welch
http://andrewjwelch.com

Current Thread