Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / July 2006

Tip: Looking for answers? Try searching our database.

format-number function & .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Craig - 25 Jul 2003 13:56 GMT
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 - 27 Jul 2003 10:13 GMT
> When I do a transform with a stylesheet containing the function
> format-number($varname,'#,##0.00') from XSLerator (which uses MSXML) I
[quoted text clipped - 8 lines]
> format-number(number($varname),'#,##0.00'), then I get what I expect.
> Anyone know why I am getting this behaviour?

That may be realted to this bug:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=a770cccceffdd45f&rnum=3

Signature

Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Eugene - 27 Jul 2006 09:02 GMT
> When I do a transform with a stylesheet containing the function
> format-number($varname,"#,##0.00") from XSLerator (which uses MSXML) I
[quoted text clipped - 15 lines]
>
> Jim Craig.

I agree

That may be realted to this bug:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=a770cccceffdd45f&rnum=3

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.