The advantage for this approach is also that you can add checkboxes dynamically, which are included immediately in the calculations. The second handler in the snippet demonstrates that.
$('#pricing').on( 'click', '[type=checkbox]', function (e) {
// all checked checkboxes in #pricing
var total = $('#pricing > [type=checkbox]:checked')
.toArray() //<= convert to array
.reduce( function (a, b) { //<= calculate sum
return a + (+b.value); //<= + operator converts to Number
},0 );
$('#total').html( total == 0 ? 'total: 0' : 'total: ' + total.toFixed(2) );
});
$('#addcbx').on('click', function (e) {
var amount = $('#cbvalue').val();
if (!amount || amount == 0) {
return true;
}
var nwcbx = $('<input type="checkbox" value="' + amount + '" \/> '+ amount+ '<br>')
.insertBefore($('#total'));
});
body {
margin: 2em;
font: 0.8em/1em normal verdana, arial;
}
#total {
width: 150px;
border-top: 1px solid #ddd;
padding-top: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="pricing">
<input type="checkbox" value=100.00 /> 100.00<br>
<input type="checkbox" value=231.00 /> 231.00<br>
<input type="checkbox" value=521.99 /> 521.99<br>
<input type="checkbox" value=22.25 /> 22.25<br>
<input type="checkbox" value=36.55 /> 36.55<br>
<input type="checkbox" value=96.32 /> 96.32<br>
<input type="checkbox" value=5.50 /> 5.50<br>
<div id="total">total: 0</div>
</div>
<p>
<input type="number" id="cbvalue" placeholder="amount" step="0.01" min="0.00" value="0.00"/>
<button id="addcbx">add checkbox for amount</button>
</p>