Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Improve convert_number function

Russ Garrett0cbdeff722c8
diff --git a/schema/functions.sql b/schema/functions.sql
index 1e95ed9..5fea140 100644
--- a/schema/functions.sql
+++ b/schema/functions.sql
@@ -73,7 +73,7 @@ DECLARE
parts TEXT[];
res NUMERIC;
BEGIN
- parts := regexp_matches(value, '^([0-9][0-9,\.]*)', '');
+ parts := regexp_matches(value, '^([0-9]+[\.,]?[0-9]*)', '');
res := replace(parts[1], ',', '.')::NUMERIC;
RETURN res;
END