first time SO user :)
I know that I can format a number like this:
format-number($value, \'###,###.00\')
But I would like to remove
format-number($value, '###,###.##')
xpath 2.0 contains conditional logic if..then..else but in the more likely case that you're in xpath 1.0 I'm afraid you'll have to either rely on XSLT to do this for you, i.e:
<xsl:variable name="myvar">
<xsl:choose>
<xsl:when test="$value > 0">
<xsl:select="format-number($value, '###,###.00')"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>>
</xsl:variable>
..or mixin an extension (.NET can do this natively, EXSLT exists otherwise, probably more options available)
To the best of my knowledge no xpath functions exist to get you out of this, but I could be missing something exotic.