Summing Currency Field

Summing Currency Field

Hi,

I'm trying to write a function to get a total sum value for each Currency field in all my records.  Her is my attempt:


float totals.SpendTotal()
{
TotalSpend=0;
for each S in Payment_Tracker
{
     TotalSpend= TotalSpend + S.Amount;
}
return TotalSpend;
}











I get following error message:


Error in statement at line number 6
The template variable TotalSpend is of type BIGINT. But you are trying to update it with an expression of type DECIMAL

I have tried int instead of float but to no avail.  Its got be something simple but I can't see it???