Formating doubles in the XML created by Liquid XML Data Binding libraries

You can control the way in which your xs:double's are formated in the XML that is produced from the XML Data Binding library.

For example you may always want to see 5 digits after the point (5.12345 or 25.12000).

You can take control of the formatting of Decimal's, Double's and Float's using schema mappings within the wizard.

  1. Press the ‘Change Schema to Object Mapping…’ button from the ‘Select Output Options’ screen in the Wizard.
  2. Find the schema item that has a double representation.
  3. In the Primitive Details section, the Type should read ‘r8’, set the Format to the required value.

The format string is language dependant.

  • C# and VB.Net see rules for string.Format
  • C++ and Visual Basic 6 see the rules for printf
  • Java see the rules for String.format