Commit 9886ddd65e29f4f90069a32982bc797c62ccd925

Authored by Braulio Bhavamitra
1 parent dd08c013

Don't show open price of 0%

Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
app/models/product.rb
... ... @@ -201,6 +201,7 @@ class Product < ActiveRecord::Base
201 201 self.inputs(true).each{ |i| t_i += 1; se_i += 1 if i.is_from_solidarity_economy }
202 202 t_i = 1 if t_i == 0 # avoid division by 0
203 203 p = case (se_i.to_f/t_i)*100
  204 + when 0 then [0, '']
204 205 when 0..24.999 then [0, _("0%")];
205 206 when 25..49.999 then [25, _("25%")];
206 207 when 50..74.999 then [50, _("50%")];
... ...