Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want 0.00 instead of 0 in xml file generated by DataSet...

Here is situation...

While debugging i realese that in my DataSet DECIMAL values are like 5, 10, 0, 10000..

I write xml file with DataSet.WriteXml() and i must have values in xml

<Price>0.00</Price>

 

I tryed google, but didnt file any solution...

 

DataGrid corect shows information, in Access attribute (price) is DOUBLE type. (doesn mather)

 

btw I tryed also

price = (dobule)0;

price = 0.00M;

...

 

Is there any fine solution for this problem, something about xml shema or globalization setting of dataSet... i use en-Us

 

Any suggestion please...

  • Administrators
Posted

Is there a reason why you require your XML to contain what is essentially formatted data?

XML is really designed to hold the raw information and not care about the presentation of that data, the UI would be responsible for the display / formatting and it would be it's responsibility to handle number of decimal places shown etc.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

yes...

 

to be honest i dont know why....

but this xml is sended to some goverment institution (in Serbia and Montenegro) and their application didnt recognize my old xml file...

 

I dont know how and why, just want to send stupid 0.00 :)

  • *Experts*
Posted

As far as I know, and what I've seen, if you want a specific format for numeric data in the XML, you'll have to do it manually. If you have a schema included in the XML (or some other kind of schema information), you may also have to define that element as text instead of numeric.

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

thaks...

Finaly i did it manually fist reading pure xml datas with xmlTextReader and then looping each text and ading ".00"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...