Converting Scientific Notation

Is there a built in way to convert a number in scientific notation into a regular number.

For example,

4.90E+12

should convert to

4901780000000.00

Any ideas???

Converting 4.90E+12 will result in 4900000000000, not 4901780000000.00. What is the source of this number? You may need to take steps to retrieve the number in a particular format that retains accuracy.

Yeah I just realized that we’ll need to get some better data from our partner if they want us to transform it into the exact number. Thanks.

Hi Reamon,
I have the same problem. Although the EAI retrieves well-formated amount from Oracle Application(check out snapshots), its format turns into scientific notation. I didn’t find any WebMethods built-in service that makes conversion to a regular format. Any ideas?

file://C:/snapshots.rar

Where exactly are you seeing the scientific notation? If you’re doing EDI conversions then you’re seeing it because of the EDI formatting routines used by convertToString. The formatting can be disabled by editing the the settings for formatDecimal. In Administrator, select EDI then Configure Field Formats. Set isEnabled or applyFormat to false.

If you’re seeing the notation in some other context, please provide the details.

Hi Reamon,
On the whole, there are 2 packages. The 1st one retrieves an Oracle Application document then, data is mapped to an XML document. The XML document(ME029FromBO) is published to the broker with correct amount values (AmountsFromBO.png). The 2nd package’s trigger is launched once the XML document is published and so, the 2nd package’s service is executed. I put a savePipelineToFile and a restorePipelineFromFile at the top of the 2nd package’s service code to check data’s values that comes from the 1st package(outPutPipeline.png). Is there any settings to disable somewhere in this case?

Pasting a link into a post isn’t the way to attach a file within the forums. I cannot see your screen shots.

XML documents cannot be directly published to the Broker. Only IS document types can be. If the IS doc type being published is using float or double for one of more of the fields, consider changing them to use the string type. Typically, float/double is to be avoided.

I don’t know how to send you the attached file. Can you give an MSN address or a Skype address?

Click on the “Go Advanced” button. There you’ll see information about adding attachments to a post.

I can’t upload the attachement file cause of its dimension. I tried to copy/paste snapshots into a word file but its size is too big…I tried to zip
the attachement file but apparently, uploading a rar file is not allowed !!!

I think that u should send me your e-mail address :wink:

RAR archives often contain viruses or malware. Use a simple image editing tool to resize your images to make them smaller and then attach them as JPG’, PNG’s or GIF’s. PaintBrush will do this or the slightly more capable (and free) Paint.Net.

Mark

I sent you in the attachment amounts values that comes from OA and amount values that goes to the target system via pipeline files. Btw, the IS document type is created from an xsd. In the IS document type that I use and for each field, there are 2 parameters in a field’s property that defines field’s type (type and content type). In my case:
type= String
content type = float{XML Schema}
Input_Pipeline_File.doc (54 KB)
Output_Pipeline_File.doc (39 KB)

The use of the float type explains why exponential notation is used. That is a perfectly legal and valid representation. http://www.w3.org/TR/xmlschema-2/#float

The question then arises on whether or not float is a good type for these fields. If these values represent money values, float is the wrong type to use. Decimal would be a better type to use. http://www.w3.org/TR/xmlschema-2/#decimal

I usually use string types for all fields, to avoid such representation and conversion issues. This is useful in the vast majority of the cases where the data is simply passed through without manipulation. If manipulation is needed (e.g. summing money amounts) then I convert the strings such that accuracy is preserved–use of float and double data types do not preserve accuracy. This article covers the issues.

I assigned an empty value to the parameter “content type” (instead of “float{XML Schema}”) and it works. I may need you for another issue, thx a lot Reamon ;)!