RE: Unclassified RE: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-22 Thread Louie Gouws
Hi,

According to my knowledge the "R#12" (in the post "R#0") is a justification
not a numeric conversion.

The Y = X '0' is a numeric conversion

If you put Y = X "R0" then you will get the same result as Y = X "0"  namely
1235

Louie

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Daly, Mark
Sent: Monday, September 20, 2004 9:25 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [U2] Numeric rounding - UV 9.4 & 10.1


Quick follow up:  One of the guys discovered this:

Run the following pgm, then uncomment out the last 2 lines and run it
again.
Watch what happens to the first value for Y
 

X = 1234.78
Y = X "0"
CRT X
CRT Y
  
* Y = X"R#0"
* CRT Y
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Unclassified RE: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-20 Thread HENDERSON MICHAEL MR
I'm on 10.0.15, Information flavour

I also get Mark's unexpected result, that is

With the last two lines commented out, the program outputs this (as
expected):-
1234.78
1235 

When I un-commented the last two lines, the output was:-
1234.78

8

Note the blank line: the later line of code has apparently affected the
output of the previous line of code!

I think I remember something about this, that maybe it was fixed in
10.0.17 or something like that.  We don't use that syntax anywhere so I
didn't worry too much.
Mark, I'd guess you're on 10.1.0, I'd try for an upgrade to 10.1.4 or
later (you'll get UniObjects for .NET, too)

HTH

Mike

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Pingilley, Ron
Sent: Tuesday, 21 September 2004 03:11
To: [EMAIL PROTECTED]
Subject: RE: [U2] Numeric rounding - UV 9.4 & 10.1

Mark,

I'm on UV 10.1.2.

The 1st value for Y didn't change after uncommenting the 2nd set
of statements.  It came back 1235 both times.  What did you observe, and
did you run this on UV 10.1.0?

--Ron Pingilley

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Daly, Mark
Sent: Monday, September 20, 2004 9:25 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [U2] Numeric rounding - UV 9.4 & 10.1


Quick follow up:  One of the guys discovered this:

Run the following pgm, then uncomment out the last 2 lines and run it
again.
Watch what happens to the first value for Y
 

X = 1234.78
Y = X "0"
CRT X
CRT Y
  
* Y = X"R#0"
* CRT Y


 
The information contained in this Internet Email message is intended
for the addressee only and may contain privileged information, but not
necessarily the official views or opinions of the New Zealand Defence Force.
If you are not the intended recipient you must not use, disclose, copy or 
distribute this message or the information in it.

If you have received this message in error, please Email or telephone
the sender immediately.
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-20 Thread Paul Trebbien
Yes, that is one of the issues with the 10.n release of UniVerse.  Note, all
of my customers use the PICK flavor of UniData and UniVerse.  I always use
OCONV and ICONV statement to control rounding and number of decimal places.
Here's an example:
ITEM.DISCOUNT=OCONV(ITEM<41>,"MD2")
UNIT.PRICE=OCONV(ITEM<20>,"MD2")*(1-(ITEM.DISCOUNT/100))

Note, we 'almost' never store formatted data (i.e. decimal places, dates,
times) and if I was to save the above UNIT.PRICE I would do so in this
manner:
ITEM<21>=ICONV(UNIT.PRICE,"MD2")

Hey, while I got the pedestal, I personally do not like printing a 4 digit
year when printing a date - (:-}.

The software package most of my customers run, DataFlo, had several
occurrences of '2' to display 2 decimal places and when they upgraded their
UniVerse to 10.n they ran into problems which I corrected simply by removing
the '2' and making sure the correct number of decimals would display
(printed form) via OCONV.

I believe IBM has corrected this issue but am not sure.

Note, I write a column in our Newsletter that's free and also is archived on
our website under the  tab on koretech.com.  Anyone interested in
receiving an email when the newsletter comes out (about quarterly) can send
an email to me pault@koretech.com removing the .

Have a Great Day!

> Paul Trebbien
> Kore Technologies, Senior Support Tech. 
> "Solutions that work. People who care."
> V 858.678.0030 F 858.300.2600 W www.koretech.com
> 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 8:37 AM
To: [EMAIL PROTECTED]
Subject: Re: [U2] Numeric rounding - UV 9.4 & 10.1


[EMAIL PROTECTED] wrote:
> I have a habbit of using the following syntax to round numbers to a
certain
> number of decimal places:
> 
> X = 1.623
> CRT X '2'
> CRT X '0'
> 
> Yields:
> 
> 1.62
> 2
> 
> It's always worked fine. Until we did an upgrade to 10.1. Now it has been
> deemed un-reliable because it produced an undesirable result (an empty
> string) in a rather sensitive program.
> 
> So, first question is:  Is this a bad habbit I've had all these years?

Yes.
> 
> Second question:  Has anyone else experienced a problem with this method
of
> rounding? Is it a known bug?

iirc, yes/no.

I seem to remember a thread on this list ages back. If you use JUST a number
as your format operator, it does not necessarily mean what you think it
does. This other thread was about it apparently producing the correct result
for ages and then suddenly going "wrong".

Basically, the number can either be interpreted as "number of decimal
places" or as "string width". That's why another poster suddenly found that
"0" returned the empty string!

iirc the manual is clear on what is the correct interpretation, but certain
implementations do/did get it wrong. As with all these things, it pays to be
explicit and not take short cuts ...

Cheers,
Wol

> ---
> u2-users mailing list
> [EMAIL PROTECTED]
> To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-20 Thread u2
[EMAIL PROTECTED] wrote:
> I have a habbit of using the following syntax to round numbers to a certain
> number of decimal places:
> 
> X = 1.623
> CRT X '2'
> CRT X '0'
> 
> Yields:
> 
> 1.62
> 2
> 
> It's always worked fine. Until we did an upgrade to 10.1. Now it has been
> deemed un-reliable because it produced an undesirable result (an empty
> string) in a rather sensitive program.
> 
> So, first question is:  Is this a bad habbit I've had all these years?

Yes.
> 
> Second question:  Has anyone else experienced a problem with this method of
> rounding? Is it a known bug?

iirc, yes/no.

I seem to remember a thread on this list ages back. If you use JUST a number as your 
format operator, it does not necessarily mean what you think it does. This other 
thread was about it apparently producing the correct result for ages and then suddenly 
going "wrong".

Basically, the number can either be interpreted as "number of decimal places" or as 
"string width". That's why another poster suddenly found that "0" returned the empty 
string!

iirc the manual is clear on what is the correct interpretation, but certain 
implementations do/did get it wrong. As with all these things, it pays to be explicit 
and not take short cuts ...

Cheers,
Wol

> ---
> u2-users mailing list
> [EMAIL PROTECTED]
> To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-20 Thread Pingilley, Ron
Mark,

I'm on UV 10.1.2.

The 1st value for Y didn't change after uncommenting the 2nd set
of statements.  It came back 1235 both times.  What did you observe, and
did you run this on UV 10.1.0?

--Ron Pingilley

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Daly, Mark
Sent: Monday, September 20, 2004 9:25 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [U2] Numeric rounding - UV 9.4 & 10.1


Quick follow up:  One of the guys discovered this:

Run the following pgm, then uncomment out the last 2 lines and run it
again.
Watch what happens to the first value for Y
 

X = 1234.78
Y = X "0"
CRT X
CRT Y
  
* Y = X"R#0"
* CRT Y


 

-Original Message-
From: Daly, Mark 
Sent: Monday, September 20, 2004 9:28 AM
To: '[EMAIL PROTECTED]'
Subject: [U2] Numeric rounding - UV 9.4 & 10.1

I have a habbit of using the following syntax to round numbers to a
certain
number of decimal places:

X = 1.623
CRT X '2'
CRT X '0'

Yields:

1.62
2

It's always worked fine. Until we did an upgrade to 10.1. Now it has
been
deemed un-reliable because it produced an undesirable result (an empty
string) in a rather sensitive program.

So, first question is:  Is this a bad habbit I've had all these years?

Second question:  Has anyone else experienced a problem with this method
of
rounding? Is it a known bug?
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-20 Thread Daly, Mark
Quick follow up:  One of the guys discovered this:

Run the following pgm, then uncomment out the last 2 lines and run it again.
Watch what happens to the first value for Y
 

X = 1234.78
Y = X "0"
CRT X
CRT Y
  
* Y = X"R#0"
* CRT Y


 

-Original Message-
From: Daly, Mark 
Sent: Monday, September 20, 2004 9:28 AM
To: '[EMAIL PROTECTED]'
Subject: [U2] Numeric rounding - UV 9.4 & 10.1

I have a habbit of using the following syntax to round numbers to a certain
number of decimal places:

X = 1.623
CRT X '2'
CRT X '0'

Yields:

1.62
2

It's always worked fine. Until we did an upgrade to 10.1. Now it has been
deemed un-reliable because it produced an undesirable result (an empty
string) in a rather sensitive program.

So, first question is:  Is this a bad habbit I've had all these years?

Second question:  Has anyone else experienced a problem with this method of
rounding? Is it a known bug?
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Numeric rounding - UV 9.4 & 10.1

2004-09-20 Thread Adrian Matthews
We noticed the same thing. Strangely we had two programs with exactly
the same line of code but they gave different results with 'n' appended
despite the var being the same before the line.

As it was mostly old r83 pick code we ditched it rather than trying to
figure out what was going on as, IMHO, it's not a very nice piece of
coding.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Daly, Mark
Sent: 20 September 2004 14:28
To: '[EMAIL PROTECTED]'
Subject: [U2] Numeric rounding - UV 9.4 & 10.1

I have a habbit of using the following syntax to round numbers to a
certain
number of decimal places:

X = 1.623
CRT X '2'
CRT X '0'

Yields:

1.62
2

It's always worked fine. Until we did an upgrade to 10.1. Now it has
been
deemed un-reliable because it produced an undesirable result (an empty
string) in a rather sensitive program.

So, first question is:  Is this a bad habbit I've had all these years?

Second question:  Has anyone else experienced a problem with this method
of
rounding? Is it a known bug?
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


The information contained in this email is strictly confidential and for the use of 
the addressee only, unless otherwise indicated. If you are not the intended recipient, 
please do not read, copy, use or disclose to others this message or any attachment. 
Please also notify the sender by replying to this email or by telephone +44 (0)20 7896 
0011 and then delete the email and any copies of it. Opinions, conclusions (etc.) that 
do not relate to the official business of this company shall be understood as neither 
given nor endorsed by it.  IG Markets Limited and IG Index Plc are authorised and 
regulated by the Financial Services Authority and, in Australia, by the Australian 
Securities and Investments Commission.
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/