Re: A simple 4gl program question
Posted in 2000
Jorge, It has to do with using a comma as a decimal point, Informix sees a comma as a concatenation. If you use a dot . as the decimal point it works ie. LET euro=escudos/200.482 Hope this helps, Sue "Jorge Silva" <mop45352@mail.telepac.pt> on 19/09/2000 08:20:40 Please respond to "Jorge Silva" <mop45352@mail.telepac.pt> To: informix-list@iiug.org cc: (bcc: Sue Davidson/EXE) Subject: A simple 4gl program question 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 DISPLAY escudos " equal to ", 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