Inline formatting trouble
Hello
I have the following rather complex memo text:
Original number: [Abs(<frxDBDatasetIncome."gross_sum">)] [IIF(<frxDBDatasetIncome."exchange_rate">>1,' ( '+(FloatToStr(<frxDBDatasetIncome."gross_sum">/<frxDBDatasetIncome."exchange_rate">) +' ' + <frxDBDatasetIncome."currency">)+' )' ,'domestic' ) ]
So in the IIF the first part is a calculated number, and then comes the currency.
The problem is that this looks like e.g. 2500 (8,3333333333333 EURO)
I want the 8,3333333333333 to be 8,33 but if I put the %2.2f before the last bracket it doesn't dot anything (perhaps because there is also a string in the expression).
The following doesn't work:
Original number: [Abs(<frxDBDatasetIncome."gross_sum">)] [IIF(<frxDBDatasetIncome."exchange_rate">>1,' ( '+(FloatToStr(<frxDBDatasetIncome."gross_sum">/<frxDBDatasetIncome."exchange_rate">) +' ' + <frxDBDatasetIncome."currency">)+' )' ,'domestic' ) %2.2f]
Please help me if you can.
I have the following rather complex memo text:
Original number: [Abs(<frxDBDatasetIncome."gross_sum">)] [IIF(<frxDBDatasetIncome."exchange_rate">>1,' ( '+(FloatToStr(<frxDBDatasetIncome."gross_sum">/<frxDBDatasetIncome."exchange_rate">) +' ' + <frxDBDatasetIncome."currency">)+' )' ,'domestic' ) ]
So in the IIF the first part is a calculated number, and then comes the currency.
The problem is that this looks like e.g. 2500 (8,3333333333333 EURO)
I want the 8,3333333333333 to be 8,33 but if I put the %2.2f before the last bracket it doesn't dot anything (perhaps because there is also a string in the expression).
The following doesn't work:
Original number: [Abs(<frxDBDatasetIncome."gross_sum">)] [IIF(<frxDBDatasetIncome."exchange_rate">>1,' ( '+(FloatToStr(<frxDBDatasetIncome."gross_sum">/<frxDBDatasetIncome."exchange_rate">) +' ' + <frxDBDatasetIncome."currency">)+' )' ,'domestic' ) %2.2f]
Please help me if you can.
Comments
and pass the whole string expression into the text of the band.
memo1.text := 'sometext' +' ' +'[expressionwith formatstring]';
it will then be calculated and formatted.
Thank you, I will try it. Mostly I try resolve the issues in the memo, because if I edit the report half a year later it is obvious what it does at first sight.
Should have read
and pass the whole string expression into the text of the memo.
BTW you can comment your code in the report just as you can in delphi.
Original number: [Abs(<frxDBDatasetIncome."gross_sum">)] [IIF(<frxDBDatasetIncome."exchange_rate">>1,' ( '+(FloatToStr(<frxDBDatasetIncome."gross_sum">/<frxDBDatasetIncome."exchange_rate">) +' ' + <frxDBDatasetIncome."currency">)+' )' ,'domestic' ) #n%2.2f]
I've never got it working without the #n.
Petter