Calculation fails sometimes?

I have a page that calculates numbers and I thought it was working correctly. For some reason the calculation returns zero in some instances (under our ratio) and not on others.

This page does not calculate
https://www.pasprintseries.com/Promo/PurseDetail.php?id=38
This page calculates (flashes NaN briefly?)
https://www.pasprintseries.com/Promo/PurseDetail.php?id=31

Both seem to calculate for me. I noticed the NaN flash, that happens when the server connect was still loading and you have some invalid data in your expression. Perhaps hide the elements while the server connect is still loading or using a conditional region.

really? under “our ratio” it worked for you? I have all 0

I see, but the TotPurse used in the calculation is 0 on that first page, so that is already returned incorrectly from the server connect action and is not a problem with the calculation.

1 Like

ah crap totally messed up there. Thanks for pointing that out. Update for m is sending no data while this form still calculates

The value of TotPurse is still 0 and it is being used in your formula:

<td dmx-text="(PurseDetail.data.query1[0].TotPurse * .0748).ceil()" class="w-25"></td>

Yes. that was already pointed out, thanks. I was looking at the total purse on the page (which is calculated) and in fact I’m pulling it from the data. I have to fix the data update field on the update form to insert that total (not zero)

So what is wrong with it?
The value returned by your data source is TotPurse: "10848" and that’s what i see in the input. What exactly is wrong?

Nothing now. I need to fix the process that inserts and updates the tot purse to mysql. It’s all good

1 Like