}
?>
Zwischensumme <input type="text" id="subtotal" value="" size="5" style="background: #ececec;text-align:right;" readonly> €
+ <input type="text" id="subtotal_tr" value="" size="5" style="background: #ececec;text-align:right;" readonly> €
<p><input type="submit" class="button" value="Bezahlen" onclick="return send_request()"> <input type="reset" class="button" value="Reset"><p>
</form>
{
var subtotal = $('input#subtotal').val();
if (typeof subtotal == 'string' && !subtotal.length) subtotal = 0;
- else subtotal = parseFloat(subtotal) * 100;
+ else subtotal = parseInt((parseFloat(subtotal) * 100).toString());
if ($(this).prop('checked'))
- subtotal += parseFloat($(this).attr('price'));
+ subtotal += parseInt($(this).attr('price'));
else
- subtotal -= parseFloat($(this).attr('price'));
+ subtotal -= parseInt($(this).attr('price'));
- if (subtotal == 0)
+ if (subtotal == 0) {
$('input#subtotal').val('');
- else
+ $('input#subtotal_tr').val('');
+ } else {
$('input#subtotal').val(subtotal / 100);
+ $('input#subtotal_tr').val((subtotal * -1 / 100).toString().replace('.', ','));
+ }
}
function send_request()