From 3918e22214b0f0fe685607e8ff74a23e10acb897 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 21 May 2014 19:12:42 +0200 Subject: [PATCH] synchronize price on two decimal places only --- app/models/article.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/article.rb b/app/models/article.rb index 084fb26e..c3f7e969 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -118,9 +118,9 @@ class Article < ActiveRecord::Base :manufacturer => [self.manufacturer, self.shared_article.manufacturer.to_s], :origin => [self.origin, self.shared_article.origin], :unit => [self.unit, new_unit], - :price => [self.price, new_price], + :price => [self.price.to_f.round(2), new_price.to_f.round(2)], :tax => [self.tax, self.shared_article.tax], - :deposit => [self.deposit, self.shared_article.deposit], + :deposit => [self.deposit.to_f.round(2), self.shared_article.deposit.to_f.round(2)], # take care of different num-objects. :unit_quantity => [self.unit_quantity.to_s.to_f, new_unit_quantity.to_s.to_f], :note => [self.note.to_s, self.shared_article.note.to_s]