Skip to content

Commit

Permalink
Fixing possible problem with cents and commas
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Dec 14, 2010
1 parent 7f696e6 commit af453e8
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -82,7 +82,7 @@ def amount=(money)
if money.is_a?(String) or cents.to_i <= 0 if money.is_a?(String) or cents.to_i <= 0
raise ArgumentError, 'money amount must be either a Money object or a positive integer in cents.' raise ArgumentError, 'money amount must be either a Money object or a positive integer in cents.'
end end
add_field mappings[:amount], sprintf("%.2f", cents.to_f/100) add_field mappings[:amount], sprintf("%.2f", cents.to_f/100).sub(/\./, ',')
end end


def order=(order_id) def order=(order_id)
Expand Down

0 comments on commit af453e8

Please sign in to comment.