Hello,
I've a table as on the image bellow where I've data from DB with quantity and price.
Them I creat a custom field where I multiply the quantity * price in order to get a total and I used the "format record field" along the columns in order to have them with the € sign.
I now want to have a "Field Footer Expression" on this custom field with the Sum of all the values I previously multiplied.
THE PROBLEM
If the multiplied field is configured as currency the "Field Footer Expression" SUM produces an error, but if it is configured as number I works ok and I can then configure the SUM as currency.
The thing is that I want both - The Costum Field with the multiplication - and the "Field Footer Expression" with the SUM of the multiplication with currency sign.
How can this be achived?
@xela05 you cannot make a calculation on a string. once the value you are dealing with contains characters other than numbers, it is a string. In other to do calculations with them you need to convert t to an integer, double or float value. You can read more here PHP - How to Convert String to Float? (tutorialkart.com) (https://www.tutorialkart.com/php/php-convert-string-to-float/#:~:text=To%20convert%20string%20to%20float%20using%20PHP%20built%2Din%20function,corresponding%20to%20the%20string%20content.&text=%24float_value%20%3D%20floatval(%20%24string%20)%3B) to understand.
$product = (float) $value1 * (float) $value2