Fixes the Birminingham speed limit bug reported by Philip Barnes

This commit is contained in:
DennisOSRM 2013-01-04 12:31:43 +01:00
parent 8ab5915983
commit 7c54d4e62f

View File

@ -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