= trips.maximum(:maximum_speed_mph).round(0).to_s
如果没有值,我如何将默认值设为零?
我能够做到这一点= number_with_precision(trips.average(:average_speed_mpg), :precision=>0) || 0
同样不适用于= trips.maximum(:maximum_speed_mph).round(0).to_s
= trips.maximum(:maximum_speed_mph).round(0).to_s
如果没有值,我如何将默认值设为零?
我能够做到这一点= number_with_precision(trips.average(:average_speed_mpg), :precision=>0) || 0
同样不适用于= trips.maximum(:maximum_speed_mph).round(0).to_s