When I do a transform with a stylesheet containing the function
format-number($varname ,'#,##0.00') from XSLerator (which uses MSXML) I
get the result I expect, a decimal number rounded to 2 places.
When I load the stylesheet & do the transform from my VB.NET or C#
code however
(i.e. using system.xml etc) I always get NaN returned.
I don't know why, it took me ages to work it out but the fix is to
cast the first parameter in the function to number, i.e.
format-number(number($ varname),'#,##0 .00'), then I get what I expect.
Anyone know why I am getting this behaviour?
The first version also always used to work from my code before I
migrated to .NET.
TIA
Jim Craig.
format-number($varname ,'#,##0.00') from XSLerator (which uses MSXML) I
get the result I expect, a decimal number rounded to 2 places.
When I load the stylesheet & do the transform from my VB.NET or C#
code however
(i.e. using system.xml etc) I always get NaN returned.
I don't know why, it took me ages to work it out but the fix is to
cast the first parameter in the function to number, i.e.
format-number(number($ varname),'#,##0 .00'), then I get what I expect.
Anyone know why I am getting this behaviour?
The first version also always used to work from my code before I
migrated to .NET.
TIA
Jim Craig.
Comment