Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Setting to round down or up?

6 posts in Appeon (partner product) Last posting was on 2009-11-06 09:26:53.0Z
Trevor Holyoak Posted on 2009-11-03 18:46:05.0Z
From: Trevor Holyoak <trevorh@uuinsurance.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: sybase.public.appeon
Subject: Setting to round down or up?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4af07a6d$1@forums-1-dub>
Date: 3 Nov 2009 10:46:05 -0800
X-Trace: forums-1-dub 1257273965 10.22.241.152 (3 Nov 2009 10:46:05 -0800)
X-Original-Trace: 3 Nov 2009 10:46:05 -0800, vip152.sybase.com
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:2423
Article PK: 21684

We discovered today that in the client server version of our
PowerBuilder application, we have a decimal being set to the value of a
decimal times a real, and the result is being round down to the tenths
place. In the Appeon version, it is apparently being rounded up.

For instance, 75.7 * 1.5 = 113.55. In PowerBuilder, it becomes 113.5. In
Appeon, it becomes 113.6.

Is there a setting somewhere to have Appeon round down like PowerBuilder
does?

Thanks,
Trevor


Steven Posted on 2009-11-04 07:58:22.0Z
Sender: 78b9.4aefbc67.1804289383@sybase.com
From: Steven
Newsgroups: sybase.public.appeon
Subject: Re: Setting to round down or up?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4af1341e.384f.1681692777@sybase.com>
References: <4af07a6d$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 Nov 2009 23:58:22 -0800
X-Trace: forums-1-dub 1257321502 10.22.241.41 (3 Nov 2009 23:58:22 -0800)
X-Original-Trace: 3 Nov 2009 23:58:22 -0800, 10.22.241.41
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:2424
Article PK: 21685

Hi Trevor,

What's your Appeon version?
I made a simple case, but can't reproduce this issue.
For examples:
Dec ldc_test
ldc_test = 75.7 * 1.5
messagebox('',ldc_test)
Dec{2} ldc_rtn
ldc_rtn = 75.7 * 1.5
messagebox('',ldc_rtn)
Could you provide some more detail scripts?

Regards,
Steven


Trevor Holyoak Posted on 2009-11-04 17:14:52.0Z
From: Trevor Holyoak <trevorh@uuinsurance.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: sybase.public.appeon
Subject: Re: Setting to round down or up?
References: <4af07a6d$1@forums-1-dub> <4af1341e.384f.1681692777@sybase.com>
In-Reply-To: <4af1341e.384f.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4af1b68c$1@forums-1-dub>
Date: 4 Nov 2009 09:14:52 -0800
X-Trace: forums-1-dub 1257354892 10.22.241.152 (4 Nov 2009 09:14:52 -0800)
X-Original-Trace: 4 Nov 2009 09:14:52 -0800, vip152.sybase.com
Lines: 60
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:2426
Article PK: 13429


Steven wrote:
> Hi Trevor,
>
> What's your Appeon version?
> I made a simple case, but can't reproduce this issue.
> For examples:
> Dec ldc_test
> ldc_test = 75.7 * 1.5
> messagebox('',ldc_test)
> Dec{2} ldc_rtn
> ldc_rtn = 75.7 * 1.5
> messagebox('',ldc_rtn)
> Could you provide some more detail scripts?
>
> Regards,
> Steven

We have tried it on version 6.1.0031.00 and 6.0.0231.00 and received the
same results on both. It turns out the problem is a little different
than what I thought. PowerBuilder does not always give precise results,
and so the rounded version is not always what you would expect. However,
our Appeon application, which does give more precise results, really has
to give the exact same results as the PowerBuilder version.

Try this:

Dec dec1, dec2, dec3
Real real1

dec1 = 75.7
real1 = 1.5
dec2 = Round(dec1 * real1, 1)
dec3 = dec1 * real1
MessageBox("Rounding Test", "75.7 * 1.5 = "+String(dec2)+ "
("+String(dec3)+")")

dec1 = 75.5
real1 = 1.5
dec2 = Round(dec1 * real1, 1)
dec3 = dec1 * real1
MessageBox("Rounding Test", "75.5 * 1.5 = "+String(dec2)+ "
("+String(dec3)+")")

For the first calculation:
On Appeon, the unrounded result = 113.55 and the rounded result = 113.6
On PowerBuilder, the unrounded result = 113.54999542236328 and the
rounded result = 113.5

On the second calculation they both get the same unrounded (113.25) and
rounded (113.3) results.

We can't change anything in PowerBuilder because this is a financial
application and the current calculations need to be consistent with
historic calculations. This is a big problem for us because we have some
people using the PowerBuilder version of our application, and some
people using the Appeon version, and the results *must* match in both
versions.

Thanks,
Trevor


Steven Posted on 2009-11-05 08:38:59.0Z
Sender: 78b9.4aefbc67.1804289383@sybase.com
From: Steven
Newsgroups: sybase.public.appeon
Subject: Re: Setting to round down or up?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4af28f23.6248.1681692777@sybase.com>
References: <4af1b68c$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 5 Nov 2009 00:38:59 -0800
X-Trace: forums-1-dub 1257410339 10.22.241.41 (5 Nov 2009 00:38:59 -0800)
X-Original-Trace: 5 Nov 2009 00:38:59 -0800, 10.22.241.41
Lines: 30
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:2427
Article PK: 21687

Hi Trevor,

Real is a floating-point number. Although the variable is
assigned as 1.5, but when it is calculating, the actual
value is less than 1.5.
Please see the scripts below:
Dec dec1, dec2, dec3
real real1
dec1 = 75.7
real1 = 1.5
dec2 = Round(dec1 * real1, 1)
dec3 = round(113.55,1)
if dec2 = dec3 then
messagebox('', 'the real value equal to 1.5')
else
messagebox('', 'the real value less than 1.5')
end if
You will get the messagebox "the real value less than 1.5".
Appeon doesn't support this feature.
Could you modify your real variable to the double variable,
so the PowerBuilder's result will be the same as the
Appeon's.
Dec dec1, dec2, dec3
double real1
dec1 = 75.7
real1 = 1.5
dec2 = Round(dec1 * real1, 1)

Regards,
Steven


Trevor Holyoak Posted on 2009-11-05 15:53:19.0Z
From: Trevor Holyoak <trevorh@uuinsurance.com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
Newsgroups: sybase.public.appeon
Subject: Re: Setting to round down or up?
References: <4af1b68c$1@forums-1-dub> <4af28f23.6248.1681692777@sybase.com>
In-Reply-To: <4af28f23.6248.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4af2f4ef$1@forums-1-dub>
Date: 5 Nov 2009 07:53:19 -0800
X-Trace: forums-1-dub 1257436399 10.22.241.152 (5 Nov 2009 07:53:19 -0800)
X-Original-Trace: 5 Nov 2009 07:53:19 -0800, vip152.sybase.com
Lines: 41
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:2428
Article PK: 21688

We can't modify the PowerBuilder variable because this is a financial
application that has been in production for many years and the changes
caused would be very problematic.

Is there no way to work around this in Appeon to get the same results?
The Appeon web site says it supports all standard data types, including
Real.

- Trevor

Steven wrote:
> Hi Trevor,
>
> Real is a floating-point number. Although the variable is
> assigned as 1.5, but when it is calculating, the actual
> value is less than 1.5.
> Please see the scripts below:
> Dec dec1, dec2, dec3
> real real1
> dec1 = 75.7
> real1 = 1.5
> dec2 = Round(dec1 * real1, 1)
> dec3 = round(113.55,1)
> if dec2 = dec3 then
> messagebox('', 'the real value equal to 1.5')
> else
> messagebox('', 'the real value less than 1.5')
> end if
> You will get the messagebox "the real value less than 1.5".
> Appeon doesn't support this feature.
> Could you modify your real variable to the double variable,
> so the PowerBuilder's result will be the same as the
> Appeon's.
> Dec dec1, dec2, dec3
> double real1
> dec1 = 75.7
> real1 = 1.5
> dec2 = Round(dec1 * real1, 1)
>
> Regards,
> Steven