Skip to content

Instantly share code, notes, and snippets.

@birarda
Created May 11, 2012 22:38
Show Gist options
  • Save birarda/2662870 to your computer and use it in GitHub Desktop.
Save birarda/2662870 to your computer and use it in GitHub Desktop.
Eventify Fee Calculator
<script>
$("input.ticketPrice").keyup(function () {
var cut = 0.0225;
var ticketPrice = $(this).val();
var totalProfit = Number(ticketPrice) + 0;
var ticketTotal = (Number(feeTotal) + Number(ticketPrice));
if ( $('#fees').prop('checked') ) {
var ticketFee = ticketPrice * cut;
var feeTotal = ticketFee + 1.00;
$("span.fees").text("$" + feeTotal.toFixed(2));
}
$("span.profits").text("$" + totalProfit.toFixed(2));
$("span.ticketTotal").text("$" + ticketTotal.toFixed(2));
}).keyup();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment