[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Zero Suppression
- Subject: Re: Zero Suppression
- From: Elvis Pressly <elvisdman@HOTMAIL.COM>
- Date: Fri, 21 Dec 2001 17:27:41 +0000
Michael,
I have been using the edit mask ~ to isolate digits.
example:
Move #Amount to $input ~~~~~x (number of digits)
if $input > 0 then .... << test if X is between 0 & 9
In PS there is an SQC (netinwds) that you can read to isolate
values of a digit.
>From: Michael Prodor <mprodor@QUALCOMM.COM>
>Reply-To: sqr-users@list.iex.net
>To: SQR-USERS@list.iex.net
>Subject: Re: Zero Suppression
>Date: Tue, 18 Dec 2001 07:35:17 -0800
>
>Thanks Denise.
>
>Happy Holidays!
>
>At 06:06 AM 12/18/2001, you wrote:
>>Hi Michael,
>>
>>How about something like this:
>>
>>if trunc(#incr_msg_chrg,2) = trunc(#incr_msg_chrg,3)
>> print #incr_msg_chrg (, {COL75}) edit $$.99
>> else
>> print #incr_msg_chrg (, {COL75}) edit $$.999
>> end-if
>>
>>I think that should work.
>>
>>HTH,
>>Denise White
>>Sr. Programmer/Analyst
>>Vicor
>>------------------------------
>>
>>Date: Mon, 17 Dec 2001 15:18:50 -0800
>>From: Michael Prodor <mprodor@QUALCOMM.COM>
>>Subject: Zero Suppression
>>
>>I asked this a while back and found that there was one hole in the
>>solution:
>>
>>
>>Hi Gurus, here is a quick question that I've been playing with for too
>>long.
>>
>>I am printing a rate field that can be up to 3 digits to the right of the
>>decimal. When it is 3 digits I want to print all three, but when there are
>>no significant digits, I want to display the cents and leave the rest
>>blank.
>>
>>For example:
>>
>>If the rate is 2.340 I want to print 2.34
>>
>>If the rate is 2.345 I want to print 2.345.
>>
>>If the rate is 2.30 I want to print 2.30
>>
>>I have tried:
>>
>> 1267 print #incr_msg_chrg (, {COL75}) edit $$.99BB
>> 1268 print #incr_chr_chrg (, {COL82}) edit $$.99BB
>>
>>and
>>
>> 1267 print #incr_msg_chrg (, {COL75}) edit $$.BBBB
>> 1268 print #incr_chr_chrg (, {COL82}) edit $$.BBBB
>>
>>and
>>
>>1244 let $= rtrim(edit(#incr_msg_chrg,'$$.999'),'0')
>>1234 print $incr_msg_chrg
>>
>>But neither work. Do I really have to interrogate the decimal portion to
>>do
>>this?
>>
>>I was going to extract the decimal portion, rtrim it and then rpad it to 2
>>places, but it seems like a lot of work.
>>
>>Anyone think of an easier way?
>>
>>Thanks!
>>
>>
>>
>>--
>>Michael Prodor
>><mprodor@qualcomm.com>
>>
>>Qualcomm - IT QWBS Business Systems
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com