Skip to content

Instantly share code, notes, and snippets.

@radar
Created January 18, 2012 05:24
Show Gist options
  • Select an option

  • Save radar/1631153 to your computer and use it in GitHub Desktop.

Select an option

Save radar/1631153 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
options.delete(:format_as_currency) ? number_to_currency(amount, :format => "<span>%u</span>%n" : amount
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment