45.224
Bearbeitungen
Meier (Diskussion | Beiträge) |
Meier (Diskussion | Beiträge) |
||
Zeile 18: | Zeile 18: | ||
* Schadenhöhe in Euro | * Schadenhöhe in Euro | ||
<html> | |||
<div> | |||
<div class="section colm colm"> | |||
<div class="qcon"> | |||
<input style="margin-bottom:10px;" class="gui-input" style="padding-left: 36px" type="number" id="inventarwert" placeholder="Gesamtinventarwert" /> Inventarwert</div> | |||
</div> | |||
<div class="section colm colm"> | |||
<div class="qcon"> | |||
<input style="margin-bottom:10px;" class="gui-input" style="padding-left: 36px" type="number" id="vsu" placeholder="Versicherungssumme" /> Versicherungssumme</div> | |||
</div> | |||
<div class="section colm colm"> | |||
<div class="qcon"> | |||
<input style="margin-bottom:10px;" class="gui-input" style="padding-left: 36px" type="number" id="vsvorsorge" placeholder="Vorsorgeversicherung" /> Vorsorgeversicherung 10-20 %</div> | |||
</div> | |||
<div class="section colm colm"> | |||
<div class="qcon"> | |||
<input style="margin-bottom:10px;" class="gui-input" style="padding-left: 36px" type="number" id="schaden" placeholder="Schadenhöhe" /> Schadenhöhe</div> | |||
</div> | |||
</div> | |||
<button id="calc">berechnen</button> | |||
<br> | |||
<br> | |||
<hr> | |||
<div class="section colm colm"> | |||
Die Höhe der Entschädigung beträgt: <span class="section" id="eur"> </span> | |||
</div> | |||
<hr> | |||
<script> | |||
document.getElementById("calc").addEventListener('click',function(){ | |||
var inventar = document.getElementById("inventarwert").value; | |||
var su = document.getElementById("vsu").value; | |||
var schad = document.getElementById("schaden").value; | |||
var vsvorsorge = document.getElementById("vsvorsorge").value; | |||
var vorsorge = (su * vsvorsorge / 100); | |||
var faktor = (su / inventar); | |||
var span = document.getElementById("eur"); | |||
entschaedigung = (((schad * su) + vorsorge) / inventar); | |||
if (entschaedigung >= schad) { | |||
var ergebnis = schad; | |||
}else { | |||
var ergebnis = entschaedigung; | |||
} | |||
var ergebnis = Number(ergebnis) ; | |||
console.log(ergebnis); | |||
//span.innerHTML = ''; | |||
span.innerHTML = '<b>'+ergebnis.toFixed(2)+' Euro</b><br>'; | |||
},false); | |||
function isNumber(n) { | |||
return !isNaN(parseFloat(n)) && isFinite(n); | |||
} | |||
</script> | |||
</html> | |||