Update application_helper.rb

Fixed `point_speed` in `application_helper.rb` to properly convert velocity from m/s to km/h, round to 1 decimal, and safely handle nil or zero values.
This commit is contained in:
Victor Goncharov 2025-06-04 00:09:23 +02:00 committed by GitHub
parent 396b9003b0
commit b05ab63f28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,9 +169,9 @@ module ApplicationHelper
end
def point_speed(speed)
return speed if speed.to_i <= 0
speed * 3.6
return "" if speed.nil? || speed.to_f <= 0
speed = speed.to_f
"#{(speed * 3.6).round(1)}"
end
def days_left(active_until)