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.
0
jim.craig (1)
7/25/2003 12:56:22 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
562 Views

Similar Articles

[PageSpeed] 8

Jim Craig wrote:
> 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?

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

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

0
oleg7603 (294)
7/27/2003 9:13:27 AM
> 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: 
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.
0
7/27/2006 8:02:11 AM
Reply:

Similar Artilces:

functions
I have created a custom function and would like it to be activated from a button on my toolbar. I have tried recording a macro to run the function but this did not work as the define range box was not presented. Thank you very much On Wed, 3 Sep 2003 03:35:40 -0700, "Chrissie Frisbee" <christina.frisbee@morgansindall.co.uk> wrote: >I have created a custom function and would like it to be >activated from a button on my toolbar. I have tried >recording a macro to run the function but this did not >work as the define range box was not presented. You'd ...

formatting #2
I have a large worksheet that I need to change the text to all caps. I have tried using the UPPER function but it will only work in one cell. How to I get the entire worksheet to become all caps? Help! Hi see http://www.cpearson.com/excel/case.htm -- Regards Frank Kabel Frankfurt, Germany Jackie wrote: > I have a large worksheet that I need to change the text to > all caps. I have tried using the UPPER function but it > will only work in one cell. How to I get the entire > worksheet to become all caps? Help! Hi Jackie If you have trouble using macros you can do this ...

Conditional Formatting #89
I need to know how to make a block turn RED if the date exceeds a year. Thanks! Do you mean if the data exceeds one year from today? If so, select the target cell, go to Format > Conditional Formatting, choose Formula Is, and put: =$A$1<DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())) Change $A$1 to your actual cell reference. HTH Jason Atlanta, GA >-----Original Message----- >I need to know how to make a block turn RED if the date exceeds a year. Thanks! >. > Try this in - Conditional Format - Formula Is: =DATE(YEAR(E1)+1,MONTH(E1),DAY(E1))<=TODAY() If E1 was ...

Excel Left/Right function
The above function will not pull "each single character" from a string. I have text strings up to 27 characters. I want to pull "each character" into a separate column. Is there a function to do this without a macro? My purpose is to delete some characters and use Data Filter on each remaining character. MID =MID(A1,startnum,numcharacters) So, if you want the 15th character and 15th character only... =MID(A1,15,1) Hope this helps. -- John C "ejay" wrote: > The above function will not pull "each single character" from a string. > I have ...

Zoom percentage and formatting palette
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel 1. How do you make sure that Word opens to a certain zoom percentage (140% for me) no matter what Word document I open? <br><br>2. How can I get the formatting palette to not be a floating box but to be incorporated right into the toolbar? <br><br>Thanks from a new user On 24/05/2010 03:00, Jerdog201@officeformac.com wrote: > Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: > Intel 1. How do you make sure that Word opens to a certain zoom > percentage ...

Sequential Numbering in Word 2003 and Recycling unused numbers
Once again, I am stuck in Macro world which is quickly consuming me :) It is though, quite addictive and I am determined to win the fight I'm having with my PC. I work for a company which uses network servers so the document needs to be accessed by different people but not necessarily at the same time. We operate Windows XP Word 2003. I am trying to create a document that will open with a sequential number, but if the document is not used or opened accidentally then the number it has generated needs to be recycled for auditing purposes. I seem to be able to get the number t...

report format portrait and lanscape
Is it possible to have one command to change report between portait or lanscape? If not, probably the best solution will be 2 reports. Your information is great appreciated, Your report is probably designed in portrait. This means it is designed to print 8-1/2" - the left and right margins wide. If you change the printout to landscape it is still going to print less than 8-1/2" wide on the left side of the paper leaving more than 3-1/2" blank on the roght side of the paper. To fill the paper you would have to write code to reposition and stretch out each con...

Number of categories between tick-marks
How do you change the "number of categories between tick-marks labels" setting under Scale of Category (x) axis scale from code? Thanks, Clint Hi, The macro recorder generated this. With ActiveChart.Axes(xlCategory) .TickLabelSpacing = 1 End With Cheers Andy cherman wrote: > How do you change the "number of categories between tick-marks labels" > setting under Scale of Category (x) axis scale from code? > > Thanks, > Clint ...

How to dial a phone number with modem quickly?
hi, all I want to use my modem to dial a phone number which is for our phone server.The only thing I want is to dial the number and make sure the phone server can detect this dial. It not necessary to make a whole connection. How to do that, does any have any idea? I tried to use RAS and use ATD command to dial, but the modem often try to establish a connectoin. So each dial, it will take a long time. I hope it dial and return in 1-2 second. Is that possible? "Nicky" <Nicky@discussions.microsoft.com> wrote in message news:E94D14BB-12BC-4CA8-890B-B2A4E191341E@microsoft.com......

How to you selectively sum on a series of numbers?
I have a column filled with numbers, but I only want to sum up a few of them. Let's say I have numbers filling A1:A10. Let's say I only want to sum up the numbers located is A3 and A4. I'd like to ability to enter something in the b column (e.g. "y" in cells b3 and b4) and have a formula that adds up the values in the "A" cells that have a corresponding "y" in the "B" column. This formula would allow me to selectively choose which cells needs to be summed. What is the best/cleanest way to write that formula? Thank you. =SUMPRODUC...

Need help with IF function
I need help writing an IF expression: IF("reference cell is empty", leave blank, otherwise statement) than -- Message posted from http://www.ExcelForum.com =IF(A1="","",Statement -- Message posted from http://www.ExcelForum.com =if(Cell Number="","",Statement) rmo5354 wrote: > *I need help writing an IF expression: > IF("reference cell is empty", leave blank, otherwise statement) > > thanx -- Message posted from http://www.ExcelForum.com To indicate a cell is empty, simply use quotes with nothing in between t...

Community bank's new software doesn't export in my format
I am still using Money98 which does all of the little tasks I need (no investments at my age). Two national banks provide exports in .qif format as a matter of course, but when my local community bank went to new (better) software, ".qif" was missing from the list of available export formats. I wrote the bank and received word that the bank's vendor didn't support Money98. The bank officer said: "My guess is the contract they have with Intuit and Microsoft stipulates they not support it as those companies want consumers to always upgrade their software.&...

Increase revision number on Purchase Order
Would like the revision number increased on a Purchase Order when the status of it changes from Change Order to Released. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=35...

Case numbering 01-26-04
I have found the auto numbering in 1.2, but it only lets me change the prefix for the cases "CAS". I need to start my numbering at 3500 instead of 1000. Is there a way to change the starting number? Thanks, Stefanie ...

find header then replace header with number of entries below heade
I have a data set that contains over 66,000 lines. I would like to search for each 'nan nan' then replace it with the number of entries that follow until the next 'nan nan'. Ex. the first 'nan nan' to be replaced with '7', second with '17'. I would also like to enter a '1' in the cell to the right of each replaced value. Thanks in advance. Kevin nan nan -89.34548 29.000135 -89.34636 28.998375 -89.346654 28.997788 -89.347534 28.997788 -89.347827 28.997495 -89.346654 28.996321 -89.341373 29.000135 nan nan -89.424686 28.9232...

Question on Formats...
This ought to be quite simple to answer. Is it possible to format the contents of a combobox? On sheet1 I have text in cells A1 to A8 e.g A1 = John, A2 = Steve, A3 = Claire etc. I have a combobox on a chart that displays those names when I click the down arrow. The default is lower case, black lettering. Can I make the names appear in bold and green for example? I have tried modifying the original names but that makes no difference. If I right click the combobox and select <Format Control> I cannot see a way to format my data entries. Maybe you can't do it. And I want to ...

Excel page format changes
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hello, <br><br>My client creates spreadsheets for her boss. She pushes the boundaries to get things to fit on the screen. <br> Uses A4, margins at 1.5cms and scales to 90%. <br><br>When her boss receives it by email the margins go to 2.5cms, scales to 100%. They have the same versions 12.2.4 and Leopard. They are just about to be upgraded to Snow Leopard. Any idea why this could be happening? Thanks. ...

two decimals - remove percentage sign
Hello everyone, I have percentages that i'm displaying in graphs with data labels. I'd like to remove the % sign so it is easier to view the data labels because the graphs are small, and i'd like to do it with custom formatting because there is quite a lot of data that i dont want to convert to whole numbers. I think the best way to do this is to somehow use custom formatting in format cells -->number-->custom to multiply by 100 and display it that way. is that possible? Thanks for the help! Adam ...

How do I reduce the number of data points I have??
Hi , I have some 10000 data points from which I need to reduce to something like 100 points before making an xy chart. Typically I would like to make a chart of every 10th point. So basically I need to reduce the length of my two rows. Is there any way I can do this easily?? Any help is highly appreciated. Thanks in advance -- swapan From the Microsoft Charting FAQ: http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=209#jon024 - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ ssan...

ASP.Net 4 TreeView Collapses on Node Click
I have an ASP.Net 4 TreeView that's being populated by a SQLSiteMapProvider and sits on a MasterPage. When I click a node the tree collapses. EnableViewState is set to True ViewStateMode is set to Enabled Am I missing something? How do I keep the tree state as it is when I click a link? "Dave" <Dave.Burkett@Jacobs.com> wrote in message news:2038c0ba-5328-4138-b615-777e02975478@c7g2000vbc.googlegroups.com... > Am I missing something? How do I keep the tree state as it is when I > click a link? This "feature" has always been there and I...

Passing 2-D array as function parameter.
If I pass a 2-D array ar[4][6] like this: foo(int ar[][6]...); What has been passed? Is it a pointer of whole array? Thanks. if you want to point to whole array you must call foo(ar) and in prototype or definition write foo (int ar[] [6]) and if you want to accsess only one row you must write foo(ar[4]) at calling the function "Frank E Rogers" <syang@pelco.com> wrote in message news:#u9vtA0UEHA.212@TK2MSFTNGP12.phx.gbl... > If I pass a 2-D array ar[4][6] like this: > foo(int ar[][6]...); > What has been passed? Is it a pointer of whole array? > Thanks. > &...

Automatic number fill-in on Labels
Is it possible to have word automatically fill in a series of numbers on Labels. I need a set of labels, counting by fives, from 1 to 3500. Just wishing I didn't have to key in every number....0001-0005, etc. See http://www.gmayor.com/Numbered_labels.htm. -- Stefan Blom Microsoft Word MVP "Bridgett" <Bridgett@discussions.microsoft.com> wrote in message news:9D380870-FF28-4227-B724-301AC3EC9A8D@microsoft.com... > Is it possible to have word automatically fill in a series of numbers on > Labels. I need a set of labels, counting by fives, from 1 ...

converting from text to numerical number
I have a spread sheet of entire year schedule. The format as following: 1 2 3 .... 31 row 1 row 2 row 3 Jan row 4 row 5 Feb row x Dec I would like to replace column 1 up to Jan to 1. Replace the cell below Jan to Feb to 2. etc. Would anyone help. Thanks in advance. You could select cells A1:A3, type a 1, then press Ctrl+Enter Select A4:A5, type a 2, and press Ctrl+Enter And so on, till all twelve months are done. james wrote: > I have a spread sheet of entire year schedule. The format as following: > > 1 2 3 .... 31 &...

IF function #11
I have this formula in my worksheet, it keeps returning "-#VALUE!-" =IF(I2:I224="x","",IF(J2:J224="x","",COUNTIF(M2:M224,"ship"))) When I go to "Show calculation steps it shows that the error is in th 'I2:I224' Is it possible to use the "IF" function when including a range of cell such as 'I2:I224' -- KellyMcG0 ----------------------------------------------------------------------- KellyMcG03's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1454 View this thread: http:/...

OL 2003; Question about two default attachments in HTMLMessage Format
This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C51E85.7F26CCA0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0010_01C51E85.7F26CCA0" ------=_NextPart_001_0010_01C51E85.7F26CCA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Outlook 2003, XPP SP2=20 Hello, When I send an e-mail message in HTML message format, the recipient = (even when I send to myself) also receives two default attachments, = image001.png and image002.png. The first image is a what I would guess a = Microsoft ...