From 664711e08464b8392c9d9c2f086a97a26717a21f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 31 Dec 2008 19:08:19 +0000 Subject: [PATCH] Fix ID: [2478307] -CurrencyRound pgsql function not working in 353 seed https://sourceforge.net/tracker2/index.php?func=detail&aid=2478307&group_id=176962&atid=879332 --- migration/353a-trunk/372_round.sql | 1 + migration/353a-trunk/postgresql/372_round.sql | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 migration/353a-trunk/372_round.sql create mode 100644 migration/353a-trunk/postgresql/372_round.sql diff --git a/migration/353a-trunk/372_round.sql b/migration/353a-trunk/372_round.sql new file mode 100644 index 0000000000..8d61dca7e9 --- /dev/null +++ b/migration/353a-trunk/372_round.sql @@ -0,0 +1 @@ +-- just for postgresql diff --git a/migration/353a-trunk/postgresql/372_round.sql b/migration/353a-trunk/postgresql/372_round.sql new file mode 100644 index 0000000000..45974819a0 --- /dev/null +++ b/migration/353a-trunk/postgresql/372_round.sql @@ -0,0 +1,9 @@ +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;