core-jgi/db/ddlutils/postgresql/functions/round.sql

11 lines
197 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 IMMUTABLE;