fjord/main.rb
2024-03-21 06:40:03 +09:00

4 lines
135 B
Ruby

UNITS = { m: 1.0, ft: 3.28, in: 39.37 }
def convert_length(length, from: :m, to: :m)
(length / UNITS[from] * UNITS[to]).round(2)
end