Sum of F0911.GLAA in Report

reivilo78

reivilo78

Well Known Member
Hi people,

I came across a strange bug in a report.
I want to make a sum of the value in AA (AmountField) of some records of F0911.
When the 2 digits of the decimals are a multiple of 10,
for example 66355.60 , and if i watch the variable containing the total in the debugger, I see "66355.6" instead of "66355.60" like it should be, because the variable is of type AA, and in the Data Dictionary AA is set to two decimals.
I want the final formatting to be three decimals and 22 characters with zero padding on the left.
So I use the BSFN B0800001 MathNumericToString, and the return of this function is 6635.56
I guess this is because the BSFN assumes there are two decimal digits and in input there is only one decimal.
here is an excerpt of my code and the ugly workaround :

//Workaround

0023 VA rpt_Entry_amount_round = floor(VA rpt_Entry_amount)
0024 VA rpt_AmountFieldPAr10 = VA rpt_Entry_amount*10
0025 VA rpt_AmountFieldPar10Round = floor(VA rpt_AmountFieldPAr10)
0026 If VA rpt_AmountFieldPAr10 is equal to VA rpt_AmountFieldPar10Round And VA rpt_Entry_amount is not equal to VA rpt_Entry_amount_round
0027 VA rpt_Entry_amount = concat(VA rpt_Entry_amount,"0")
0028 End If
0029 Math Numeric To String
VA rpt_Entry_amount -> BF mnMathNumeric
"N" -> BF cIncludeSign
"18.00" -> BF mnBeforeDecimalPoint
"Y" -> BF cIncludeDecimalPoint
"3.00" -> BF mnAfterDecimalPoint
VA rpt_Entry_Amount_String <- BF szString

Do you know a better way to solve this issue ?
 
Back
Top