Melorum,
<script>
$(function() {
function calc(sum,percent,dayCount) {
percent = Number(percent)||0;
sum = Number(sum)||0;
dayCount = Number(dayCount)||0;
var result = sum*percent;
for (var i=0;i<dayCount;i++){
result=result*percent;
}
return result;
}
var sum = $('#sum');
var percent = $('#percent');
var days = $('#day');
$('#calcButton').click(
function () {
var result = calc(sum.val(),percent.val(),days.val());
$('#result').html(result);
}
)
});
</script>