Last active
August 29, 2015 13:56
-
-
Save jendiamond/9105538 to your computer and use it in GitHub Desktop.
def price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool