[xsd-users] XSD Serialization for decimal field type

Zhijie Wang zwang at liquidcapital.com
Mon Apr 1 21:48:46 EDT 2013


Hi Boris,

Thanks a lot for your information.

Best regards,
Zhijie


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: 01 April 2013 19:45
To: Zhijie Wang
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] XSD Serialization for decimal field type

Hi Zhijie,

Zhijie Wang <zwang at liquidcapital.com> writes:

> Seems XSD convert it to the precision of 15 decimal digit. As I want 
> to set it to one decimal digit value, is there a way I can truncate it 
> to
> 1594.8 for this case?
>
> [...]
>
> <xs:restriction base="xs:decimal"/>

There are several ways to achieve this. The easiest and cleanest is to specify the fractionDigits facet in the schema. Other options are to use a macro or to customize the type. See the README file in the examples/cxx/tree/custom/double example for details.

Boris


Liquid Capital Australia Pty Limited is registered with the Australian Securities and Investment Commission and located in Australia. 
Liquid Capital Markets Hong Kong Limited is registered with the Securities and Futures Commission in Hong Kong and
located in Hong Kong. 
Liquid Capital Investments Hong Kong Limited and Liquid Capital Securities Hong Kong Limited are registered and located in Hong Kong. 
For more information about these companies, please contact + 61 2 8231 1159.

Please click this <a href=http://www.liquidcapital.com/group/index.php?
location=/web/General/Disclaimer>link</a> for terms relating to all email correspondence.




More information about the xsd-users mailing list