Proration Formula using eomonth

Proration Formula using eomonth

I'm trying to auto calculate a first month Prorated Discount.  

I have an install date field (not dateTime).
A currency field for the subscription price.
The hangup I'm having is I cannot simply get the last day of the month in a variable to use in a formula.

I'm aiming for this:

(SubCost/DaysInMonth)*(DaysInMonth - InstallDate)
  1. DealRec = zoho.crm.getRecordById("Deals",DealID);
  2. InstallDate = eomonth(DealRec.get("Install_Date"),0);
  3. update = zoho.crm.updateRecord("Deals",DealRec.get("Deal_Name").get("id").toLong(),{"Days_In_Month":InstallDate});
I've tried adding modifiers to line 2 to convert to a number, but I'm not able to get past th execution error.  I'm fairly inexperienced with Java/Deluge but pretty good with sql.  

I appreciate any input/help :)