Bug #5554
FWD processed (0) format element in a non-compatible way
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/20/2021
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
History
#2 Updated by Igor Skornyakov about 5 years ago
The '(0)' format element in the 4GL string(char, char) has a strange effect. For example:
string('3.1415926', 'N(0)#a(2)') = '3)#'
string('acc3.1415926', '9!(0);N(4);;#a(2)//') = 'aC);c3.1;;#41'
I cannot understand the underlying logic so far. In particular ignoring trailing format elements.
Please note that Java UDF produces another (more logical) result:
select public.tostring('acc3.1415926', '9!(0);N(4);;#a(2)//')
returns
'aC;c3.1;;#41//'#3 Updated by Igor Skornyakov about 5 years ago
Greg suggested an explanation of the underlying 4GL logic. See #4551-131.
My test (xfer.goldencode.com/opt/testcases/formats/stostring.p) show that this explanation looks correct.