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

veki

New member
Joined
Mar 10, 2006
Messages
3
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...
 
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 its responsibility to handle number of decimal places shown etc.
 
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 :)
 
As far as I know, and what Ive seen, if you want a specific format for numeric data in the XML, youll 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
 
thaks...
Finaly i did it manually fist reading pure xml datas with xmlTextReader and then looping each text and ading ".00"
 
Back
Top