Re: A simple 4gl program question
Posted in 2000
--- Jorge Silva <mop45352@mail.telepac.pt> escribi': > In i4gl, a simple program is to convert pte > (portuguese escudo) in > equivalent euro amount . > Pte 200,482 = Euro 1,00. > I tried this: > MAIN > CALL escudoseuro() > END MAIN > > FUNCTION escudoseuro() > DEFINE escudos, euro money(10,2) > PROMPT" INPUT PTE AMOUNT -" > FOR escudos > LET euro=escudos/200,482 Correct the above statement: LET euro=escudos/200.482 > DISPLAY escudos " equal to Correct the above statement DISPLAY escudos," equal to ",euro," euro " AT 3,3 > ", euro, " euro" AT 3,3 > END FUNCTION > > I received the following message error: " The > variable "euro" is not a > character type, and cannot be used to contain the > result of > concatenation." ----- ok I changed the variable euro > to a character one > euro char(15) ). > > The program runs. I introduce the amount of pte > 100 the result is > 0,50 -- great , after I tried pte 1.000,00 the > result was 5,00 when > the correct one is 4,99(euro). > For example for pte 5.000.000,00 the correct value > is 24.939,89, the > result of the program is 25.000,00. > > What can I do to obtain precision values? > > > Thanks > Jorge > > ===== ______________________________________ Luis Carlos D'az Otero ALCANOS DE COLOMBIA S.A. E.S.P Carrera 9 # 7-25 Neiva (Huila (Colombia)) __________________________________________________ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/