I have
<xsl:value-of select="DifferenceInDays" />
DifferenceInDays
can be negative or positive, I want to display it as positive. How can I do this?
I have
<xsl:value-of select="DifferenceInDays" />
DifferenceInDays
can be negative or positive, I want to display it as positive. How can I do this?
This can be achieved using the xpath abs function.
<xsl:value-of select="abs(DifferenceInDays)"/>
In XPath 1.0 (XSLT 1.0) use the following expression:
$vNum*($vNum >=0) - $vNum*($vNum < 0)
In XPath 2.0 (XSLT 2.0) use the abs()
function.