Bug #7484
decimal format - left-side 'balance' must include group separators
100%
History
#2 Updated by Constantin Asofiei 10 months ago
This format is valid in OE: ->,>>>,>>9.9<<<<<<<<
.
We have logic in NumberType.parseFormat
which computes a leftBalance
, but this is not incremented for the group separator. Including the group separator solves the issue.
The recreate is this:
def var h as handle. create temp-table h. h:add-new-field("f1", "decimal", ?, "->,>>>,>>9.9<<<<<<<<").
The fix is as simple as this:
for(; i < len; i++) { switch (fmt.charAt(i)) { case '>': leftBalance++; digits++; leftDigitFmt += fmt.charAt(i); break; case FORMAT_GROUP_SEP: leftBalance++; // <!--------------- include the group separator leftSeps++; break; default: break endLeftSection; } }
#4 Updated by Constantin Asofiei 10 months ago
Greg Shah wrote:
Is the problem that an error 22 is raised in FWD but not in OE?
Correct.
What happens in the case where there is a mixture of
>
and other digit types (9
,z
,Z
,*
)?
Only the >
and ,
(group sep) from left-side are balanced with the right-side <
. The other 9
, z
, Z
, *
are not included in this balance.
#5 Updated by Greg Shah 10 months ago
What happens in the case where there is a mixture of
>
and other digit types (9
,z
,Z
,*
)?Only the
>
and,
(group sep) from left-side are balanced with the right-side<
. The other9
,z
,Z
,*
are not included in this balance.
In the 4GL? I know that is how the FWD code is written. I'm just wondering if the 4GL considers all the group seps in the case where some left side digits are not >
.
#6 Updated by Constantin Asofiei 10 months ago
Greg Shah wrote:
What happens in the case where there is a mixture of
>
and other digit types (9
,z
,Z
,*
)?Only the
>
and,
(group sep) from left-side are balanced with the right-side<
. The other9
,z
,Z
,*
are not included in this balance.In the 4GL?
Correct, I've tested now in 4GL.
I'm just wondering if the 4GL considers all the group seps in the case where some left side digits are not
>
.
As far as I can tell only the group sep characters and >
are considered from left-side. But I've tested the group-sep on the right-side - this can be used, and is also included in the 'balance' for the right-side.
#8 Updated by Constantin Asofiei 10 months ago
- Status changed from New to Review
- Assignee set to Constantin Asofiei
- % Done changed from 0 to 100
Created task branch 7484a from trunk rev 14648. The fix is in rev 14649.
#11 Updated by Constantin Asofiei 10 months ago
7484a was merged to trunk rev 14650 and archived.