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]

Reply via email to