Reputation: 171
I want to Remove the zeros or any other values after point(eg 12.000000000000). I am using xslt code .my code is like
<xsl:if test="value!= ''">
<tr>
<td>
value
</td>
<td>
<xsl:value-of select="value"/>
</td>
</tr>
</xsl:if>
how can I achive this?
Upvotes: 3
Views: 1129
Reputation: 1796
You can use the format-number function:
<xsl:value-of select="format-number(value,'#')"/>
Refer to: http://www.w3.org/TR/xslt/#format-number
Upvotes: 1
Reputation: 243479
Just use:
substring-before(concat(value, '.'), '.')
This works for any value -- not just a number. The result is correct even if value
doesn't contain any dot character.
Upvotes: 0
Reputation: 3314
Use Number formatting as:
<xsl:if test="value!= ''">
<tr>
<td>
value
</td>
<td>
<xsl:value-of select="format-number(value,'0')"/>
</td>
</tr>
</xsl:if>
Upvotes: 3