i have a problem with price calculation script:
this is the code:
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
function getRBtnName(GrpName) {
var sel = document.getElementsByName(GrpName);
var fnd = -1;
var str = '';
for (var i=0; i<sel.length; i++) {
if (sel[i].checked == true) { str = sel[i].value ; fnd = i; }
}
// return fnd; // return option index of selection
// comment out next line if option index used in line above
return str;
}
function DisplayPrice(price){
var val1 = getRBtnName('deckung').split(',');
var sum = parseFloat(val1[0]+0);
document.getElementById('totalSum').value=sum +",- €";
}
onload=function() {
DisplayPrice();
}
The problem is that i get the prices without a second place!
Example: get price 1368.5 € But need this to display as 1368.50 €
can anybody help me with this issue?