Ahh, I think I understand the source of your problem.
You're using JDK 1.5 (or higher?).
XMLBeans is designed to work for JDK 1.4 (and built with 1.4 for
the binary distribution).
There was a change in java.math.BigInteger and java.math.BigDecimal
(so this problem affects xs:integer too) from 1.4 to 1.5.
In 1.5, the behavior of the toString() method was changed and
the toPlainString() method was introduced:

public String toPlainString()

    Returns a string representation of this BigDecimal without 
    an exponent field. ... (This method behaves analogously to 
    the toString  method in 1.4 and earlier releases.)

- Wing Yew

-----Original Message-----
From: Joe White [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 14, 2008 6:00 AM
To: user@xmlbeans.apache.org
Subject: RE: Scientific notation decimal type

Yes, we were setting the value as a BigDecimal. Since my email we've
discovered a different email thread that indicates that the cause of the
problem was the toString() method in BigDecimal. The toString() in
BigDecimal returns scientific notation. The solution is to change the
call to the toString() to "toPlainString()" which produces the desired
format for the output.

To do this we changed line 37 in
org.apache.xmlbeans.impl.values.JavaDecimalHolder in the 2.3.0 tag 

From:
        protected String compute_text(NamespaceManager nsm) { return
_value.toString(); }

To:
        protected String compute_text(NamespaceManager nsm) { return
_value.toPlaintring(); }

That change solved the problem with the output format.

Thank you for your help
Joe

- If you still want sample code that produced the old behavior let me
know and I will send some over.

-----Original Message-----
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 13, 2008 6:16 PM
To: user@xmlbeans.apache.org
Subject: Re: Scientific notation decimal type

That is very strange. Are you setting the value as a BigDecimal? Some
sample code would help.

Radu

On Wed, 2008-03-12 at 10:46 -0600, Joe White wrote:
> I have a very simple schema that I would like to return a price from
> (below). However when I generate output the prices are returned in
> scientific notation. Is there a way to suppress the scientific
> notation output?
> 
>  
> 
> Thank you for your help
> 
> Joe 
> 
>  
> 
>  
> 
>  
> 
> <xs:schema xmlns="urn:rt"xmlns:xs="http://www.w3.org/2001/XMLSchema";
> 
>       targetNamespace="urn:rt"elementFormDefault="qualified">
> 
>       <xs:simpleType name="money">
> 
>             <xs:restrictionbase="xs:decimal">
> 
>             <xs:
> 
>                   <xs:fractionDigitsvalue="2" />
> 
>             </xs:restriction>
> 
>       </xs:simpleType>
> 
>       <xs:simpleType name="price">
> 
>             <xs:restrictionbase="xs:decimal">
> 
>                   <xs:fractionDigitsvalue="2"/>
> 
>             </xs:restriction>
> 
>       </xs:simpleType>
> 
> </xs:schema>
> 
> 

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to