Different output of decimal value when assigned to string then reassigned back
Iwan AB <[email protected]> Sat, 2 Apr 2022 13:15:26 +0700
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAHJCSmLeimf8p+-AqUy05WxFsFXPWZXLM7JD311tBLsESsY-jA@mail.gmail.com> |
Dear Mike,
Consider the following program:
MAIN
DEFINE w DEC(5,3), x DEC(12,2)
DEFINE s CHAR(20), t CHAR(80)
LET w = 1.075
LET x = 12345678.75
LET s = w
LET t = "1. w=", w, "; s=w => s=", s
LET w = s
LET t = t CLIPPED, "; w=s => w=", w
DISPLAY t CLIPPED
LET s = x
LET t = "2. x=", x, "; s=x => s=", s
LET x = s
LET t = t CLIPPED, "; x=s => x=", x
DISPLAY t CLIPPED
END MAIN
Compiled with Aubit-4GL, the output is:
1. w= 1,075; s=w => s=1.075; w=s => w=
2. x= 12345678,75; s=x => s=12345678.75; x=s => x= 1234567875,00
Compiled with Informix-4GL, the output is:
1. w= 1,075; s=w => s=1,075; w=s => w= 1,075
2. x= 12345678,75; s=x => s=12345678,75; x=s => x= 12345678,75
Why is that in Aubit-4GL, the value of the decimal variable when assigned
to a string and then reassigned the back string to the variable, the value
is different?
In Informix-4GL, the value is the same.
I use A4GL_NUMERIC=,. (comma and period)
Best Regards,
Iwan Abu Bakar
_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss