0

I have float member, and when I serialize it to a file I'd like to have it in a specific format (for example

 string.Format("{0:0.00}",someFloat)

Can I put the formatter in the xml attribute of this member? and if so what is the exact syntax of doin it?

1
  • I don't know of if we can add formatter in XML attribute or not but please refer to this link. The second answer may help you. stackoverflow.com/questions/7404650/… Commented Mar 13, 2013 at 6:07

1 Answer 1

0

Serialization used to transform data to universal readable and palatable format. Yo don't need to format when serialize. you can format it when you show in UI. if you really need to do this, check this SO answer Can you specify format for XmlSerialization of a datetime?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.