Skip to content

Instantly share code, notes, and snippets.

@jendiamond
Last active August 29, 2015 13:56
Show Gist options
  • Save jendiamond/9105538 to your computer and use it in GitHub Desktop.
Save jendiamond/9105538 to your computer and use it in GitHub Desktop.
def price
def price
number_to_currency(source.price, precision: 2) ||
if variation
then number_to_currency(variation.price, precision: 2)
else number_to_currency(product.price, precision: 2)
end
end
module JobsHelper
def to_dollar(amount)
if amount < 0
number_to_currency(amount.abs, :precision => 0, :format => "-%u%n")
else
number_to_currency(amount, :precision => 0)
end
end
end
@blackland1954
Copy link

Cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment