lazysheepmedia
Member
Folks
I'm having a bit of trouble with a calc element that is trying to calculate two fields. The set up is as follows
(A) - Rent Received is a field set as decimal with 2 decimal places
(B) - Agency Fee Due is a calc element which produces the right % fee to be charged
The final calc element should calculate A - B = Amount due to landlord
The code I have in the calc element is:
But its not working
If I change {rent_received___rent_fee_due} to be {rent_received___rent_fee} which is a CDD element displaying a number (for example 10) then the calc element displays the right number
It is clearly a problem with the the code I am using but I don't know what -
Any help appreciated
Thanks
I'm having a bit of trouble with a calc element that is trying to calculate two fields. The set up is as follows
(A) - Rent Received is a field set as decimal with 2 decimal places
(B) - Agency Fee Due is a calc element which produces the right % fee to be charged
The final calc element should calculate A - B = Amount due to landlord
The code I have in the calc element is:
PHP:
$x=(float){rent_received___rent_paid} - {rent_received___rent_fee_due};
return '?'.number_format($x,2);
But its not working
If I change {rent_received___rent_fee_due} to be {rent_received___rent_fee} which is a CDD element displaying a number (for example 10) then the calc element displays the right number
It is clearly a problem with the the code I am using but I don't know what -
Any help appreciated
Thanks