You are not looking at the correct indexes and you need one more position after the #
$(function() {
$('.pricefield input').on("click",function () {
var sum=0;
$('input:checkbox:checked').each(function () {
var str=$(this).val().split("#")[1].split(",");
sum += (parseInt(str[0], 10) + parseInt(str[1], 10));
});
pricefield_both(sum); // assuming that function works
});
});