Author |
Message
|
Adi3 |
Posted: Fri Aug 17, 2007 12:37 pm Post subject: ROUND in ESQL not working as expected |
|
|
Novice
Joined: 19 Dec 2006 Posts: 15
|
ROUND(1.9150)
Returns 1.92
which is correct
But
ROUND(1.9450)
Returns 1.94 (weird behaviour of esql function)
which is incorrect, the result should be as 1.95
I need this Round logic to be working as expected. Is there any function in esql gives the perfect Rounding.
Please help me. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 17, 2007 2:36 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Have you considered reading the documentation on the ESQL Round function, to find out if it has any options you can specify to change how it works, or to find out what you should expect it to do? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Adi3 |
Posted: Fri Aug 17, 2007 6:45 pm Post subject: ROUND not working as expected |
|
|
Novice
Joined: 19 Dec 2006 Posts: 15
|
I referred the ESQL Document and found nothing relevant that is the reason I posted here to get masters help |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Aug 17, 2007 7:26 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
Adi3 |
Posted: Sat Aug 18, 2007 10:08 am Post subject: |
|
|
Novice
Joined: 19 Dec 2006 Posts: 15
|
Jeff, Thanks a lot!
I referred the ESQL manual but not the Information center. Here after, I will refer the Information center too. Its working as expected with the mode ROUND_HALF_UP. |
|
Back to top |
|
 |
Adi3 |
Posted: Mon Aug 20, 2007 6:33 am Post subject: |
|
|
Novice
Joined: 19 Dec 2006 Posts: 15
|
By seeing the example and table in the Information Center. I replied that ROUND_HALF_UP is working.
The list of modes given for Round are:
ROUND_UP
ROUND_DOWN
ROUND_CEILING
ROUND_FLOOR
ROUND_HALF_UP
ROUND_HALF_EVEN
ROUND_HALF_DOWN
But when I tried with ESQL coding that particular mode alone is throwing the error. All other modes are working. But for my requirement I need ROUND_HALF_UP mode to work.
Please help me. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 20, 2007 7:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What is the error being thrown?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Adi3 |
Posted: Mon Aug 20, 2007 8:20 am Post subject: |
|
|
Novice
Joined: 19 Dec 2006 Posts: 15
|
Even If I select the mode from the drop down list, it says as follows:
Severity Description Resource In Folder Location Creation Time
2 Syntax error. Valid options include: ROUND_CELLING ROUND_DOWN ROUND_FLOOR ROUND_HALF_DOWN ROUND_HALF_EVEN ROUND_HALF_UP ROUND_UP ss.esql sample line 8 August 20, 2007 12:18:35 PM
This is the ESQL code:
SET X = ROUND(2.5,0 MODE ROUND_HALF_UP);
All the modes working except this mode. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 20, 2007 9:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you open a PMR yet? _________________ MQ & Broker admin |
|
Back to top |
|
 |
Adi3 |
Posted: Tue Aug 21, 2007 10:52 am Post subject: |
|
|
Novice
Joined: 19 Dec 2006 Posts: 15
|
It works fine with the MB runtime fixpack3 and MB tool kit interim fix008.
Thank you. |
|
Back to top |
|
 |
|