Patch #14740 » RM_14740_display_hours_decimals_only_if_fractional.diff
| 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_i = hours.to_i |
|
| 33 |
if hours != hours_i |
|
| 34 |
hours_s = ("%.2f" % hours)
|
|
| 35 |
else |
|
| 36 |
hours_s = hours_i |
|
| 37 |
end |
|
| 38 |
l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => hours_s) |
|
| 32 | 39 |
end |
| 33 | 40 |
|
| 34 | 41 |
def ll(lang, str, value=nil) |