I have strings representing currencies from all over the world, I've stripped the currency symbols but I'm struggling with commas in the output.
sum(CASE
WHEN (t.value ~ '^([0-9]+.?[0-9]*|.[0-9]+)$'::text) THEN (t.value)::numeric
ELSE (0)::numeric
END),
I get the following error with this:
invalid input syntax for type numeric: "750,000"
I can't make sense of the regex, everything here should parse only 0-9 and escape '.', but there's a comma leaking through and I can't see where that could happen.