[Home] [By Thread] [By Date] [Recent Entries]
I'm not 100% sure I really understand your question (do you expect the
minus sign or don't you?) but I think any problem like this lies in the
fact that when you use sum() on undeclared values, you sum them as
xs:double, which is an unprecise floating point type, resulting in the
sum being close to zero, but not exactly zero. I haven't tried your code
yet, but if you declare your $nodes variable as xs:decimal+ I think you
will get the expected result:
<xsl:variable name="nodes" select="b" as="xs:decimal+"/> When doing numerics, I always force myself to use typed variables. You can use any simple type with a Basic processor, and xs:decimal is a simple type. Come to think of it, when you force yourself to *always* use typed variables, you will win on three ends: your code will be more readable, the processor will have more hints to optimize for speed and, most importantly, coding problems (bugs) will be found way easier because the compiler has more to tell you on each error. Hope this points you in the right direction, Cheers, -- Abel Braaksma Angela Williams wrote: Why does this not output 0.00? When formatted, I end up with -$0.00.
|

Cart



