Author |
Message
|
Prasi |
Posted: Wed Aug 03, 2011 10:18 am Post subject: Double to Decimal conversion |
|
|
Apprentice
Joined: 03 Aug 2011 Posts: 42
|
Hi,
I am facing problems when converting an exponent value like
99.9999999999E15(Double). The value is getting round off and sets as 100000000000. My message set has decimal as datatype.
I am using MB7.0.
Since this s an amount field, I dont want to get trimmed off.
Please help. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 03, 2011 11:34 am Post subject: Re: Double to Decimal conversion |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Prasi wrote: |
Hi,
I am facing problems when converting an exponent value like
99.9999999999E15(Double). The value is getting round off and sets as 100000000000. My message set has decimal as datatype.
I am using MB7.0.
Since this s an amount field, I dont want to get trimmed off.
Please help. |
Looking at the size of the number is that really 100 E 15 or is it (100 E15) -1 in which case most math will round it up...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Aug 03, 2011 1:53 pm Post subject: Re: Double to Decimal conversion |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
Prasi wrote: |
99.9999999999E15(Double) |
Double? Which language is that? Where is the code that sets and converts the value? |
|
Back to top |
|
 |
Prasi |
Posted: Wed Aug 03, 2011 6:50 pm Post subject: Double to Decimal conversion |
|
|
Apprentice
Joined: 03 Aug 2011 Posts: 42
|
We are receiving the Double value from Host System (Finnacle) when we are trying to convert the value into Decimal using compute node in ESQL.
its round off the value as above. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 03, 2011 7:49 pm Post subject: Re: Double to Decimal conversion |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Prasi wrote: |
We are receiving the Double value from Host System (Finnacle) when we are trying to convert the value into Decimal using compute node in ESQL.
its round off the value as above. |
OK so what is the limit values for double and for a decimal?
How many bytes are used for the representation?
I figure we might have an order of grandeur thing here where due to the size 100E15 - 1 is rounded up to 100E15 because of the size of the number...
You realize we are talking about 100,000 trillion here right? Is this about the national debt ceiling?? I don't believe a $1.00 more or less will make any difference there....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Prasi |
Posted: Wed Aug 03, 2011 8:57 pm Post subject: Double to decimal conversion |
|
|
Apprentice
Joined: 03 Aug 2011 Posts: 42
|
For double it is (16,4), For decimal we have just declared as xsd:decimal.But when we use XSLT we are getting proper value. With ESQL , its getting trimmed off. |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Aug 04, 2011 3:30 am Post subject: Re: Double to Decimal conversion |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
Prasi wrote: |
We are receiving the Double value from Host System (Finnacle) when we are trying to convert the value into Decimal using compute node in ESQL. |
There are a few details missing. How does this Double value get from the Host System to the compute node in ESQL? What sort of rounding errors might it encounter along the way? What data type does this value have within the ESQL, before converting it to Decimal? Where is the code that converts this Double value to Decimal? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Aug 04, 2011 8:23 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
There are a few details missing. |
I agree. If you really want us to help, then please
- post the output of a Trace node showing the Double value *before* it is converted
- post the code that performs the conversions
- post the output of a Trace node *after* the conversion
Or post the user trace showing the execution of the CAST statement ( if you are using CAST - you have not yet told us how you are performing the conversion ). |
|
Back to top |
|
 |
|