Advertisement
Guest User

Untitled

a guest
Jan 11th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. function newBetCalculate() {
  2. var total = 0;
  3. $("#betpoll .item").children('input[name="worth"]').each(function( index ) { total += parseFloat($(this).val()); });
  4. total = Math.round(total * 100) / 100;
  5. $(".yourValValue").html(total);
  6. $(".teamAValue").html( Math.round((valB*total/valA) * 99) / 100 );
  7. $(".teamBValue").html( Math.round((valA*total/valB) * 99) / 100 );
  8. var totalKey = 0;
  9. $("#betpoll .item").children('input[name="ldef_index[]"]').each(function( index ) { totalKey += parseInt($(this).val()) == 15003 ? 1 : 0; });
  10. $(".yourValKey").html(totalKey);
  11. $(".teamAKey").html( Math.round((keyB*totalKey/keyA) * 97) / 100 );
  12. $(".teamBKey").html( Math.round((keyA*totalKey/keyB) * 97) / 100 );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement