0

I have this piece of code:

<xsl:value-of select="format-number(/object/data/row/EGL_1244 - /object/data/row/EGL_1886,'0.00')"/>

The idea is it subtracts EGL_1886 from EGL_1244 and displays the result as a number.

However, on occasion each value can have a comma in it. So the value "1,234.56" would make the result show NaN.

How can I rework the code to handle incoming data values that have commas?

Thanks.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by xmlstudent
0

Answer was:

<xsl:value-of select="format-number(number(translate(/object/data/row/EGL_1244, ',', '')) - number(translate(/object/data/row/EGL_1886, ',', '')), '0.00')"/>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.