From 7c54d4e62fc84b29915dc618fd3dba2962752e92 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Fri, 4 Jan 2013 12:31:43 +0100 Subject: [PATCH] Fixes the Birminingham speed limit bug reported by Philip Barnes --- profiles/car.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/car.lua b/profiles/car.lua index 1e2d6c379..4a633b4e3 100644 --- a/profiles/car.lua +++ b/profiles/car.lua @@ -64,13 +64,14 @@ local function parse_maxspeed(source) if source == nil then return 0 end - local n = tonumber(source) + local n = tonumber(source:match("%d*")) if n == nil then n = 0 end if string.match(source, "mph") or string.match(source, "mp/h") then n = (n*1609)/1000; end + io.write("speed: "..n.."\n") return math.abs(n) end