Use:
format-number(translate(., ',','.'), '#.###,000', 'd')
This transformation:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:decimal-format name="d"
decimal-separator="," grouping-separator="."/>
<xsl:template match="/">
<xsl:value-of select=
"format-number(translate(., ',','.'), '#.###,000', 'd')"/>
</xsl:template>
</xsl:stylesheet>
when applied on the provided XML document:
<Add_Amount>2,59</Add_Amount>
produces the wanted result:
2,590
The problem with your code is that 2,59
isn't a valid number and must be converted to such, before passing this as the first argument of format-number()
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…