Calculation on Column

jesperlowe

New Member
Hi

I?m volenteering with a charity foundation doing an annual house to house collection.

I have created a "donation" database that show how much each person has collected on that one yearly donation walk.



i have the amount i bills and amount i coins.

I calculate them with

$elementa = '{indsamling___Belob_mont}';
$elementb = '{indsamling___Belob_sedel}';
$result = $elementa + $elementb;
return number_format ($result, 2, ",", ".");

And i get the right results in the form before saving.

I?m using the year to filter on at the moment, but the result is the same with and without filter

But when looking at the total in the list, i get a strange amount that sometimes fits with the decimal being moved 2 places right and sometimes its way off not having anything to do with the 2016 Collection.

rk_fejl.jpg

beloeb.JPG
 
The calc is OK, doesn't matter if it returns a string or a number.

The problem is the "Sum" calculation on the column. Which is because you are storing the value as a non standard number format, x.xxx,xx. The "sum" calculation is done in MySQL, using SUM(), which expects normal decimal numbers, with no thousand sep and a . for the decimal point.

I don't think there is a work around for this. Column calculations has to use standard number formats.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top