This mostly is a "Rule of 72" calculator - you know, the idea that an amount doubles in value period equal to 72 years divided by the interest rate (expressed as an integer.) For example, 50 becomes 100 in 18 years, at a constant 4% yearly interest rate - 72/4 = 18 ( eg, On many calculators you can type 50 then "*" then 1.04 then press "=" 18 times - On a scientific calculator type
1.04·Y^x·18·=·X (times)·50· = . And, Yes! Precision is a big issue! But we're just talking rough figures here.)
Now here's the deal: inflation ...
What is the inflation rate if first class postage was 4 cents in 1960 and 60 years later is 60 cents?
What is the inflation rate if a gallon of gas was 35 cents in the 60s and is 350 60 years later?
Hint: to tweak the inflation percentage, enter the initial value, the period (years) then, leaving the final value at zero, in the percentage slot, instead of 5, try 4.1 through 4.9 to see which Final Value is closest to current price.
Display notes for users
Show/Hide JavaScript source code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Super Simple FutureValue Calculator</title>
<meta name="description" content="Super Simple FutureValue Calculator">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1;">
<link rel="stylesheet" type="text/css" href="https://copy.exchange/stylesheet.css">
<script language="JavaScript" type="text/javascript">
function ToggleDisplay( d ) {
var obj = document.getElementById( d ) ;
obj.style.display = ( obj.style.display == 'none' ) ? 'block' : 'none' ;
}
function Hide( d ) {
if ( d != null ) { document.getElementById( d ).style.display = "none" ; }
}
function Reveal( d ) {
if ( d != null ) { document.getElementById( d ).style.display = "block" ; }
}
function CalcFutureValue() {
var r = 1 ; var rf = 1 ; var ix = 1 ; var xp = 200 ; var ir = 1 ; var tr = 1 ; var tv = 1 ;
var Years = "72" ;
var StartingValue = "10" ;
var EndingValue = "20" ;
var ffp = 0.00001 ;
var FutureValue = "Please enter required data in the form and then press 'calculate' " ;
var ip = Math.floor( document.FutureValueinq.years.value ) ;
var isv = parseFloat( document.FutureValueinq.begVal.value ) ;
var iev = parseFloat( document.FutureValueinq.futVal.value ) ;
var r = parseFloat( document.FutureValueinq.rate.value ) ;
if ( ( ip <= 0 ) || ( isv <= 1 ) ) { FutureValue = "Either a valid interest rate entered as an integer or a valid final value are required as input" ; }
else {
if ( r <= 0 ) {
var ffp = iev ;
var iv = isv
var ir = 1 ;
var rf = 1 ;
var fr = 1 ;
var dd = ffp - isv ;
if ( dd > 0 ) {
while( ( ffp > iv ) && ( ip > ir ) ) {
ix = 1 ;
iv = isv ;
fr = parseFloat( ( ir * 0.01 ).toFixed(6) ) ;
while ( ( ffp > iv ) && ( ip >= ix ) ) {
iv = parseFloat( ( ( 1 + fr ) * iv + .005001 ).toFixed(4) ) ;
ix ++ ;
}
ir ++ ;
}
FutureValue = "An initial deposit of " + isv + " should compound to " + iv.toFixed(2) + " in " + ip + " years at a rate of " + fr + " per year " ;
}
else { FutureValue = "The entered dollar amounts need correction" ; }
}
else {
var ix = 1 ;
var ffp = isv ;
fr = parseFloat(( r * 0.01 ).toFixed(4) ) ;
while( ix <= ip ) {
ffp = parseFloat( ( ( 1 + fr ) * ffp + .005001 ).toFixed(4) ) ;
ix ++ ;
}
FutureValue = "For " + ip + " years at a " + fr + " rate of interest, " + isv + " should compound to " + ffp.toFixed( 2 ) ;
}}
document.forms[ "FutureValueval" ].displayFutureValue.value = FutureValue ;
}
</script>
</head>
<body>
<center>
<h1>Super Simple FutureValue Calculator</h1>
</center>
<style type="text/css">
div.ED input { font: 14px Verdana ; color: #C60000 ; text-align: center ; width: 100% ; font-weight: bold ; height: 25px ; border: 0 ; background-color: transparent ; }
</style>
<center>
<form name="FutureValueinq" >
deposit* (nnn)
<input name="begVal" maxlength="4" size="4" type="text" value="0" style="text-align: center ; " >
years* (nn)
<input name="years" maxlength="4" size="4" type="text" value="0" style="text-align: center ; " >
APR % (nn)
<input name="rate" maxlength="3" size="3" type="text" value="0" style="text-align: center ; " >
OR end (nnn)
<input name="futVal" maxlength="4" size="4" type="text" value="0" style="text-align: center ; " >
<input type="button" value="Calculate" onClick="return CalcFutureValue() ; " class="x" >
</form>
<br><br>
<div align="center" class="ED">
<form id="FutureValueval" ><br>
<input type="text" name="displayFutureValue" >
</form>
</div>
<br>
<div align="left" id="FVnotes" style="display: none ; margin-left: 25% ; margin-right: 25% ; font: 16px courier ; " >
<p>
This mostly is a "Rule of 72" calculator - you know, the idea that an amount doubles in value period equal to 72 years divided by the interest rate (expressed as an integer.) For example, 50 becomes 100 in 18 years, at a constant 4% yearly interest rate - 72/4 = 18 ( eg, On many calculators you can type 50 then "*" then 1.04 then press "=" 18 times - On a scientific calculator type
1.04·Y^x·18·=·X (times)·50· = . And, Yes! Precision is a big issue! But we're just talking rough figures here.)
</p><p>
Now here's the deal: inflation ...
<br>
What is the inflation rate if first class postage was 4 cents in 1960 and 60 years later is 60 cents?
<br>
What is the inflation rate if a gallon of gas was 35 cents in the 60s and is 350 60 years later?
</p><p>
Hint: to tweak the inflation percentage, enter the initial value, the period (years) then, leaving the final value at zero, in the percentage slot, instead of 5, try 4.1 through 4.9 to see which Final Value is closest to current price.
</p>
</div>
<br>
<p><a href="javascript: ToggleDisplay( 'FVnotes' ) ; " class="v" >Display notes for users</a><br></p>
<p> <br><a href="javascript: ToggleDisplay( 'FutureValuecode' ) ; " class="v" >Show/Hide JavaScript source code</a><br></p>
<div style="font: 9px Verdana ; padding: 10px ; display: none ; margin-left: 20% ; margin-top: 2% ; " id="FutureValuecode" align="left" >
<?php
$jw = '/home/esand/public_html' ;
$root = $jw.'/theCopyExchange/futureValue' ;
if ( ( $sc = fopen( $root.'/futureValue.php', 'r' ) ) != false ) {
while ( ( $record = fgets( $sc ) ) != false ) {
$record = str_replace( '&', '&', $record ) ;
$record = str_replace( '<', '<', $record ) ;
$record = str_replace( '>', '>', $record ) ;
print( $record.'<br>' ) ;
}
fclose( $sc ) ;
}
else { print( 'File not found in '.$root.'<br>' ) ; }
?>
</div>
</center>
<div style="font: 11px Verdana ; color: #808080 ; text-align: center ; ">
<p> <br>
<a href="https://copy.exchange/futureValue/futureValue.php" class="t" >clear form</a> · <a href="javascript:
contactWindow=window.open( 'https://copy.exchange/futureValue/contact.htm','_blank','location=0,left=1,top=1,height=400,width=400' ) ; contactWindow.focus() ; " class="t" >Feedback</a>
<br></p>
</div>
</body>
</html>