Commit e30ebf50 by Jason Bau Committed by Diana Huang

move currency formatting into template

parent ee10cf7e
......@@ -51,12 +51,11 @@ def register_for_verified_cert(request, course_id):
def show_cart(request):
cart = Order.get_cart_for_user(request.user)
total_cost = cart.total_cost
amount = "{0:0.2f}".format(total_cost)
cart_items = cart.orderitem_set.all()
form_html = render_purchase_form_html(cart)
return render_to_response("shoppingcart/list.html",
{'shoppingcart_items': cart_items,
'amount': amount,
'amount': total_cost,
'form_html': form_html,
})
......
......@@ -21,7 +21,7 @@
<td><a data-item-id="${item.id}" class='remove_line_item' href='#'>[x]</a></td></tr>
% endfor
<tr><td></td><td></td><td></td><td>${_("Total Amount")}</td></tr>
<tr><td></td><td></td><td></td><td>${amount}</td></tr>
<tr><td></td><td></td><td></td><td>${"{0:0.2f}".format(amount)}</td></tr>
</tbody>
</table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment