users@jaxb.java.net

Re: format of decimal

From: David Rosenstark <david.rosenstark_at_corp.idt.net>
Date: Tue, 10 Jun 2003 09:47:14 +0300

Sorry, I meant to write BigDecimal. Originally, i had modified the binding
to be a double and thought maybe that was why it was not working. I then
removed the modification and saw that my output was still not valid based on
the schema.


Date: Mon, 9 Jun 2003 08:22:02 -0700
From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Subject: Re: format of decimal

David Rosenstark <david.rosenstark_at_corp.idt.net> wrote:
> I am having trouble with the following.
>
> I have xml defined to allow only 2 decimal places:
> <xs:simpleType name="AmountType">
> <xs:restriction base="xs:decimal">
> <xs:totalDigits value="6"/>
> <xs:fractionDigits value="2"/>
> </xs:restriction>
> </xs:simpleType>
>
> When i pass a double to this, the resulting XML does not enforce this.
What
> am i doing wrong?

I thought the default binding for decimal is BigDecimal. How do you
set a double value?