mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
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:
parent
396b9003b0
commit
b05ab63f28
1 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue