Skip to content

Instantly share code, notes, and snippets.

@ThroughTheNet
Created January 17, 2012 17:29
Show Gist options
  • Save ThroughTheNet/1627675 to your computer and use it in GitHub Desktop.
Save ThroughTheNet/1627675 to your computer and use it in GitHub Desktop.
def order_subtotal(order, options={})
options.assert_valid_keys(:format_as_currency, :show_vat_text)
options.reverse_merge! :format_as_currency => true, :show_vat_text => true
amount = order.total
out = options.delete(:format_as_currency) ? number_to_currency(amount) : amount
content_tag(:span, out, :class => "foo")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment