I am using the following code below to get the price from the attribute data-price
which is assigned to radio buttons like so: data-price="25.00"
jQuery(document).ready(function($){
var frm = document.forms.myForm;
frm.onchange = function(e) {
var tot = 0;
for( var i = 0, l = frm.elements.length; i < l; i++ ) {
if( frm.elements[i].checked ) {
tot += parseFloat( frm.elements[i].getAttribute('data-price') );
}
}
document.getElementById('total').value = ( tot );
}
})
The problem I am getting is that when it dispalys it in the input box for the following example it would only show 25 I need it to say 25.00 is there a way around this?