Code: Select all
...
put fld "input" into age -- contains the age in years
put 67 - age into Y
## To see if it is really anumber
ANSWER Y
put max(1,Y) into x
...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
...
put fld "input" into age -- contains the age in years
put 67 - age into Y
## To see if it is really anumber
ANSWER Y
put max(1,Y) into x
...
Code: Select all
on mouseUp
put fld "input" into age -- contains the age in years
put max(1,67-age) into x -- avoid division by zero
put 1000000 into v -- the target amount
put 0.1 into r -- the interest rate 10% of one = 0.1
put yearlyAmount(x,r,v) into fld "output"
end mouseUp
function yearlyAmount x,r,v
put v/((((1+r)^x)-1)/r) into ann
return format("%.2f",ann) -- cash format = two digits
end yearlyAmount
Code: Select all
put field "input" into tAge
if tAge is a number then
put 67 - tAge into Y
put max (1,Y) into X
else
answer "tAge is not a valid number and contains" && tAge
end if
So do I, but finally I decided to believe him, must be my good education...
So, if you have 10%, and you want to express that as a decimal (which is what you need to do the calculation), you do this -Explanation:
To convert from percents to decimals, you divide the percent by 100, which gives you decimal equivalent of the percent.
Code: Select all
10 / 100 = .1