I'm using javascript to pad numbers in my xslt file. but when debugging I get an error saying.
Extension function parameters or return values which have Clr type 'ConcatString' are not supported.
How can I fix this?
xslt
<xsl:template name="padNumber">
<xsl:param name="value"></xsl:param>
<xsl:param name="length"></xsl:param>
<xsl:value-of select="user:PadDigits($value,$length)"/>
</xsl:template>
javascript
function PadDigits(n, totalDigits)
{
n = n.toString();
var pd = '';
if (totalDigits > n.length)
{
var i;
for (i=0; i<(totalDigits-n.length); i++)
{
pd += '0';
}
}
pd = pd + n.toString();
return pd;
}
Change your PadDigits to return strings:
return "" + pd;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With