XSL – rounding/format-number problem

Not sure why format would be so inconsistent but from memory the spec for it is…complex.

Meantime, you can use the round function (ref). Which is less than perfect, but is functional. If you need to have a particular number of sig figs you can use THE POWER OF MATHS! and do something like:

<xsl:value-of select="round(yournum*100) div 100"/>

Leave a Comment