Skip to main content
Topic: Under List Page - Summing the field on formatted records causing an error (Read 1098 times) previous topic - next topic

Under List Page - Summing the field on formatted records causing an error

Under the list page, I have a field called "deposit".

I formatted this "deposit" field to "--to_currency('en-US')--", which is working

Then I would like to get the total deposits by using the Field Footer Expression.
When I do this, I will get an error because I think it's adding the strings instead the number.

What should I do to avoid the problem?

Re: Under List Page - Summing the field on formatted records causing an error

Reply #1
Hi, @decongie you will have to cast the value to int by manually editing the file and adding the  (int) keyword, on the error line after the = sign or by removing the currency formatter or by removing the currency formatter and editing the field as custom to manually add you currency to it.

 

Re: Under List Page - Summing the field on formatted records causing an error

Reply #2
@willvin ,

What I did instead is to use CustomCode to do the formatting of the record.
This will allow the FieldFooterExpression to sum the records without doing any conversion..