0

We use XmlSerializer to serialize object into xml file. The input data's that is passed by object into xml file is in simple form, for ex, 9.3nA and 80 pA but they are displayed in its scientific notation as 9.3E-09 and 8E-11 respectively. I want them to be displayed in its simple form and not scientific notation. I have been trying to research on it but could not find a solution. Is there any way to accomplish this?

Any help will be appreciated!

Thanks!

jamilia
  • 359
  • 4
  • 14
  • what are their data types? – snow_FFFFFF Jul 08 '15 at 17:57
  • Why does it make a difference? Is somebody viewing the XML? Maybe ad d a style sheet to your html. – jdweng Jul 08 '15 at 18:35
  • They are of custom type Ampere. Customer aren't quite satisfied as they want in the simplest form. – jamilia Jul 08 '15 at 22:13
  • What is the C# data type that is being serialized? – snow_FFFFFF Jul 09 '15 at 13:05
  • We add this property dynamically and so its actually of type 'object' as I'm uncertain of the data types and we expect any type to be cast to object. – jamilia Jul 09 '15 at 21:32
  • I'm going to stand by my answer below. If you want to output a specific format, you probably need to serialize it as a string. I'm still confused by your explanation - if you want more input, you should update your question with the object definition and serialization code. Without that, it isn't clear what you are doing. – snow_FFFFFF Jul 10 '15 at 13:28

1 Answers1

0

I'd be curious what your data types are. Regardless, the XML is representing the values of your data - not formatting. If you want it formatted a specific way, it probably needs to be a string. Otherwise, I would say that it would be up to the consumer of the xml to format the value as appropriate for its needs.

snow_FFFFFF
  • 3,235
  • 17
  • 29