veki Posted March 29, 2006 Posted March 29, 2006 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... Quote
Administrators PlausiblyDamp Posted March 29, 2006 Administrators Posted March 29, 2006 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
veki Posted March 29, 2006 Author Posted March 29, 2006 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 :) Quote
*Experts* Nerseus Posted March 29, 2006 *Experts* Posted March 29, 2006 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 Quote "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
veki Posted March 31, 2006 Author Posted March 31, 2006 thaks... Finaly i did it manually fist reading pure xml datas with xmlTextReader and then looping each text and ading ".00" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.