Moving functions and calculations out of the template with code snippets and inserting results into the template worked for me.
Sample: https://docs.pods.io/code-snippets/return-calculated-value-pods-template/
Custome Code with pods: https://docs.pods.io/faqs/where-should-i-put-code-for-use-by-pods/