[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: cannot get rid of decimal point



Charu,
   This is probably the most basic way to create the desired output:

....
let #w_amt = round(#I_tot,2)            ! Round Amount 2 decimals
let #w_amt = #w_amt * 100               ! Shift decimal positions
let $w_amt = edit(#w_amt,'099999999')   ! Edit 9999999V99

write 1 from ....      -
             $w_amt:9  -
             ....

This should do the trick without losing decimal places...
12.54 will be written as 000001254
                                            -Tony DeLia


Charu Srinivas wrote:
>
> Hi everyone,
>
> I am using Oracle and SQR.
>
> I m trying to create a flat file with values from the PeopleSoft table. One
> of the fields is numeric. I want it to look like 9(7)V99
> i.e without any decimal points and it should be left padded with zeros.(
> e.g 12.54 should look like 000001254)
> Then I move it to a character variable so that i can write it to the flat
> file.
>
> I tried using move #var to $var 0999999V99 but it gives me a decimal point
> and right pads it with zeros i.e
> 12.54 looks like 12.5400000
>
> If any of you have suggestions, I would greatly appreciate it.
>
> Thanks in advance -Charu

--
Tony DeLia
AnswerThink Consulting Group
PeopleSoft Solutions Practice - Delphi Partners
tdelia@erols.com