I'm trying to take two 7 digit numbers (source and target record counts) and calculate the percentage of missing records in the target count.
For example, my record counts could be 4084094 for the source, and 4081313 for the target. I'm also using the follow formula to calc the percentage: ((1 - (target / source)) * 100)
For my example, I should get the value of about .0681%
I'm am new to Java and JSP, and I'm not able to get the percentage to display correctly. I seem to only get a value rounded down to 0.
I've also tried BigDecimal, to no avail.
Even the following simple code displays the value of 1-1, so I obviously am doing somthing seriously wrong:
<%
BigDecimal percentMiss;
long tmp = 600/500;
percentMiss = BigDecimal.valueOf(tmp);
%>
<%=percentMiss.toString()%>-<%=tmp%>