Field zeros out on print?

Hi all-
I have a custom field called “number of cases” that is calculated by dividing two other fields to determine how many cases. Everything works great and it shows on the print view correctly but as soon as you actually print it or print to PDF, it puts zero in the column? The first screenshot is from the preview in ERPNext. The second is from the PDF it created.
This is my formula on Purchase Order and like I said, it works until actual print.
cur_frm.doc.items[i].number_of_cases = cur_frm.doc.items[i].qty/ cur_frm.doc.items[i].casepack;

50 52

Do you know why this is happening or how I can fix it?
Thank you!

Any ideas on this? Support at ERPNext told me they are unable to help and my only hope is posting on this forum. Any thoughts on why or how this may occur would be great!

To be clear, I have other custom fields that do not do this. This is my only field that is actually a calculation though so perhaps it has something to do with that? Thanks!