Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Fix bug in convert_power

Russ Garrettd98f0d6f646d
diff --git a/functions.sql b/functions.sql
index d7f7804..3c252ed 100644
--- a/functions.sql
+++ b/functions.sql
@@ -13,7 +13,7 @@ DECLARE
parts TEXT[];
val NUMERIC;
BEGIN
- parts := regexp_matches(upper(value), '([0-9]+[\.,]?[0-9]+)[ ]?([KMG]?W)?', '');
+ parts := regexp_matches(upper(value), '([0-9]+[\.,]?[0-9]*)[ ]?([KMG]?W)?', '');
val := replace(parts[1], ',', '.');
IF parts[2] = 'KW' THEN
val := val * 1e3;