This topic is locked

Calculating totals

11/16/2007 2:45:03 PM
PHPRunner General questions
B
bbanks author

I have a master detail page where the master page has a field for total vacation days available and the details page shows all vacation days used and totaled.
On the details page I am trying to subtract the total used days from the total available days but it doesn't seem to be that easy.
Here is what I have so far...
You have Used a total of {$showtotal_Used} Days Leaving {$showmaster_TotalDays}-{$showtotal_Used} remaining
I am attempting to write this in the visual editor of the details list page.
This is what it shows when I load the page...
You have Used a total of 4 Days Leaving 10-4 remaining
It should say...
You have Used a total of 4 Days Leaving 6 remaining
It is reading the variables, I just can't get it to subtract showmaster_TotalDays minus showtotal_Used.
Can anyone please help?

A
alang 11/16/2007

I would suggest inserting a PHP code snippet in the visual editor (assuming ver 4.1). You can then do the maths in PHP and output results with an echo .. line.