format-number function & .NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Craig

    #1

    format-number function & .NET

    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.
  • Oleg Tkachenko

    #2
    Re: format-number function & .NET

    Jim Craig wrote:[color=blue]
    > 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?[/color]

    That may be realted to this bug:


    --
    Oleg Tkachenko

    Multiconn Technologies, Israel

    Comment

    • Eugene

      #3
      RE: format-number function & .NET

      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.
      I agree

      That may be realted to this bug:



      Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.

      Comment

      Working...