var table = $('#minmax_table').DataTable();
$('#minmax_table').dataTable().fnClearTable();
total = 0
<% @products.each_with_index do |available, key| %>
  total += <%= available.product.price_base * (available.stock_max - available.stock) %>
  var row = $('<%= j render partial: "min_max", locals: { available: available, key: key } %>');
  table.row.add(row).draw();
<% end %>
total = parseFloat(total).toFixed(2);
$("#total").val(total);
total = "$ " + total + " MXN";
$("#total_prods").html(total);
// $('#total_prods').html(accounting.formatMoney($("#total").val()) + ' MXN');
// $('#total_prods').html(accounting.formatMoney(total + "MXN");
