Same problem as CHAR, same shape of fix. A DECIMAL(10,2) maps to C#'s
decimal, which carries neither the declared precision nor the scale, so
2.5 printed where 4GL prints 2.50, and it printed bare where 4GL right
aligns it in 12 columns.
Both are supplied where the declaration is still known. The assignment
wrapper - already used for CHAR - now also emits
L_d = Fgl.Scale(expr, 10, 2);
which rounds to the declared scale and forces the trailing zeros, since
Math.Round reduces a scale but never extends one. The width is the
declared PRECISION plus two and is passed at the DISPLAY site, where
expr_datatype still knows it:
Display("div =", Fgl.Disp(L_d, 10));
Adds IsNull, AsDecimal and CompareString to the runtime, which generated
code calls unqualified.
A third end-to-end probe covers FOR, WHILE, IF, CASE, arithmetic, string
concatenation, a function with a return value, a compound condition and
IS NULL. All three end-to-end probes pass, as do the other four and the
188 unit tests.