Project

General

Profile

Patch #14740 » RM_14740_display_hours_decimals_only_if_fractional_alternative.diff

Daniel Felix, 2013-08-22 15:27

View differences:

i18n.rb (revision 1907)
28 28
    
29 29
    def l_hours(hours)
30 30
      hours = hours.to_f
31
      l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => ("%.2f" % hours.to_f))
31
      # Smile specific : do not display decimals if zero
32
      hours = (hours == hours.to_i) ? hours.to_i : ("%.2f" % hours)
33
      l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => hours)
32 34
    end
33 35
    
34 36
    def ll(lang, str, value=nil)
(2-2/4)