I have a calculator I am updating and there seems to be an issue with one of the outputs.
The link to the calculator is here
http://www.x.com/nea/calculators/contribution/2007/defaultincorrectlimits.aspxIf you enter in information and press calculate, it offers a number of different read outs, and allows you to change scenarios. On the last table on the results page, "Contributing Enough to get the full employer match", the percentage for "Contribution Percentage to Maximize your match" is spitting out the wrong number, and appending a negative sign to it. I have traced back the financial equations, and I think the problem lies with in this piece of code here :
function CalculateRemainingPayPerio
ds() as integer
dim todaysDate as datetime
if not request.querystring("Simul
atedDate")
is nothing then
if isDate(request.querystring
("Simulate
dDate")) then
todaysDate = request.querystring("Simul
atedDate")
else if now < CDate("1/7/2008") then
todaysDate = CDate("1/7/2008")
else
todaysDate = now
end if
else if now < CDate("1/7/2008") then
todaysDate = CDate("1/7/2008")
else
todaysDate = now
end if
dim todaysYear as integer = todaysDate.year()
dim intPayPeriodsRemaining as integer = 0
dim dateStartPayPeriod as datetime = "1/7/2008"
do while dateStartPayPeriod <= todaysDate
dateStartPayPeriod = dateStartPayPeriod.addDays
(14)
loop
do while dateStartPayPeriod.year() < todaysYear + 1
dateStartPayPeriod = dateStartPayPeriod.AddDays
(14)
intPayPeriodsRemaining += 1
loop
return intPayPeriodsRemaining
end function
So basically I am a little lost - "Simulated Date" is not found anywhere in the code except for here - and I am not sure what this piece of code is doing, but the function is written to determine the amount of pay periods left in the year each time the visitor visits the page, but I think that it is written on - Anyone point me in the right direction, It would be very much appreciated
Start Free Trial