I'm developing web services using Fuse 6.2.1 (Switchyard, Apache Camel) and Maven, and I'm having a problem with fields with the type which I want them to handle values up to a precision of 23 and a scale of 2. Whenever I have a value with a precision over 7, then the format changes to Scientific Notation. Since I'm working in a Bank, this is a mayor issue
An example field on my XSD for my service is as follows:
<xs:element minOccurs="1" name="amount" type="xs:decimal" />
Later I switched the declaration to this:
<xs:element minOccurs="1" name="amount" >
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2" />
<xs:totalDigits value="23"/>
<xs:pattern value="[0-9][.][0-9]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
But the scientific notation, stays the same way. In my java code I'm printing the variable and the format is correct, and more important, my service has 2 routes inside the camel, one for SOAP, and one for REST (JSON) and the JSON response is the one with the problem, SOAP works great, so I'm guessing the problem is creating the Json response but I'm not sure how to handle this
In my many test, I have a Table with this field value "1234567890123456789.00" and on SOAP I get: 1234567890123456789.00 but on Json: "amount": 1.23456789012345677E18
Please if anyone knows how to solve this