#= require jquery-1.8.2.min.js
#= require jquery-ui-1.9.0.custom.min.js
$(->
$('.date').datepicker()
$.getJSON('transactions', (data) ->
$.each(data.transactions, ->
$('tbody').append("""
| #{this.date} |
#{this.address} |
#{parseFloat(this.exchange).toFixed(2)} |
#{parseFloat(this.received).toFixed(2)} |
#{(this.received * this.exchange).toFixed(2)} |
""")
)
btc = 0
$('td:nth-child(4)').each(->
btc += parseFloat($(this).html())
)
$('#btc').html(btc.toFixed(2))
cad = 0
$('td:nth-child(5)').each(->
cad += parseFloat($(this).html())
)
$('#cad').html(cad.toFixed(2))
)
)