Log in

View Full Version : finances calculating script



marcus27
05-18-2015, 08:17 PM
im looking for a script that would calculate a main figure and add a second figure to the first one but put this in a subtotal area so that area changes but the other 2 figures dont change. and i want the subtotal figure to be able to change daily so that every day it would add the second figure to the subtotal and each day repeats.

All this is an interest calculator on a page on my computer that is open and everyday it updates itself when the date changes and updates the subtotal figure so i can see what the amount currently is.

if anyone can help me i would be much appreciative

Deadweight
05-18-2015, 11:06 PM
I can prolly make this but I am kinda lost. You first started talking about two different figures then you switched to "area" then back to figures. An example would be great in this case.

Thanks,

marcus27
05-19-2015, 12:00 AM
Hi DW,

ok basically I have just won a court case and a few old ones but not paid out yet.

So for example lets say I was awarded £20,000 and the interest is 8% per Annum so the daily Interest to be added is £5.40 (I know this is not the true amount but im just using any figure for this)

I want a SubTotal area that everyday when the next day starts its adds the daily interest to the £20,000 that is in the subtotal area, and then again the next day the interest adds to the subtotal and each day the subtotal amount will change and incease.

But I want it to display the Award amount and then display the Daily Interest and then under that the subtotal amount. And maybe have something like a box with how many days have passed or how many days interest have been added from the original figure.

I know this might sound like a pointless thing but I want to keep track of my judgements that are awarded and keep an eye on how much the money goes up, this is mainly for when im dealing with enforcement and knowing the amount of interest due.

Would the page have to be refreshed to see the changes each day or could I add a refresh script to be set when to refresh the page?

thank you

mark

vwphillips
05-21-2015, 11:56 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title></title>
</head>

<body>
<form>
Days <input name="days">
<br>
InitialAmount <input name="Initial">
<br>
Intrest <input name="Intrest">
<br>
Total <input name="Total">
<br>
</form>
<script type="text/javascript">

function zxcDayCounter(year,month,date){
return Math.floor((new Date()-new Date(year,month-1,date,0,0,1))/(1000*60*60*24));
}

var DailyIntrest=5.40;
var InitialAmount=20000;
var days=zxcDayCounter(2015,5,19); // year month date

var frm=document.forms[0];
frm.days.value=days;
frm.Initial.value=InitialAmount;
frm.Intrest.value=DailyIntrest*days;
frm.Total.value=InitialAmount+DailyIntrest*days;

</script>
</body>

</html>

marcus27
05-23-2015, 08:35 PM
Hi there,

this script is great and have just tried it and its just what im looking for, I do have 1 question is there anyway to stop the interest box from changing? because i notice it increases at the same time as the total under it.

thank you