Update of /cvsroot/monetdb/sql/src/sql
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17395
Modified Files:
Tag: SQL_2-22
ms_functions.sql
Log Message:
Correct the function ms_round...
Truncate does not work with floats ;)
Index: ms_functions.sql
===================================================================
RCS file: /cvsroot/monetdb/sql/src/sql/ms_functions.sql,v
retrieving revision 1.1
retrieving revision 1.1.12.1
diff -u -d -r1.1 -r1.1.12.1
--- ms_functions.sql 10 Oct 2006 17:03:27 -0000 1.1
+++ ms_functions.sql 8 Mar 2008 23:45:32 -0000 1.1.12.1
@@ -15,8 +15,8 @@
CREATE FUNCTION MS_ROUND(num float, precision int, truncat int)
RETURNS float
BEGIN
- IF (truncat = 0)
- THEN RETURN ROUND(num, precision);
- ELSE RETURN TRUNCATE(num, precision);
- END IF;
+ IF (truncat = 0)
+ THEN RETURN ROUND(num, precision);
+ ELSE RETURN ROUND(FLOOR(num), precision);
+ END IF;
END;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins