core-jgi/migration/353a-354a/postgresql/372_round.sql

10 lines
186 B
PL/PgSQL

CREATE OR REPLACE FUNCTION round (
IN NUMERIC, -- $1 numeric
IN NUMERIC -- $2 numeric
) RETURNS NUMERIC AS
$$
BEGIN
RETURN ROUND($1, cast($2 as integer));
END;
$$ LANGUAGE plpgsql;