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

Community Page
Last updated: