[xsde-users] Controlling double precision for xs:decimal

Andrea Tessadri tessadriandrea at gmail.com
Wed Apr 3 03:54:25 EDT 2019


Since I am using cxx-hybrid I already have the serializer for the
simpleType Latituide generated by XSDe in the -simpl.hxx file

class LatitudeType_simpl: public LatitudeType_sskel
{
  public:
  LatitudeType_simpl ();

  virtual void
  pre (const ::LatitudeType&);

  public:
  ::xml_schema::decimal_simpl base_impl_;
};

Also, this serializer is already assigned to every aggregate type _saggr
corresponding to every object that is using the Latitude tag.
How to configure the precision of the Latitude tag (in every object using
it) leaving untouched other elements based on ::xml_schema::decimal_simpl ?
Of course, I wouldn't like to change the generated code.

On Mon, Apr 1, 2019 at 3:37 PM Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Andrea Tessadri <tessadriandrea at gmail.com> writes:
>
> > The result of the serialization for:
> > Latitude().base_value(-83.12345);
> >
> > will be:
> >
> > <Latitude>-83.123450000000005</Latitude>
> >
> > How to control double precision ?
>
> You can either configure the built-in decimal serializer or provide your
> own. See "Floating-Point Type Serializers":
>
>
> https://codesynthesis.com/projects/xsde/documentation/cxx/serializer/guide/#7.1
>
> BTW, please don't post new questions by replying to an existing email
> since this breaks threading. See Posting Guidelines for this and other
> points:
>
> https://codesynthesis.com/support/posting-guidelines.xhtml
>


More information about the xsde-users mailing list