r1669: numeric type translation improvements
[clsql.git] / sql / utils.cl
index d2ff84438bb573255bfe9d5ebb6322dec93ee0b1..aa0aa334042c9484bec0a2fbd89f5a4af630c4a2 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:   Kevin M. Rosenberg
 ;;;; Date Started: Mar 2002
 ;;;;
-;;;; $Id: utils.cl,v 1.1 2002/03/26 14:11:59 kevin Exp $
+;;;; $Id: utils.cl,v 1.2 2002/03/27 05:04:19 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
 (in-package :clsql-sys)
 
+(defun number-to-sql-string (num)
+  (etypecase num
+    (integer
+     num)
+    (rational
+     (float-to-sql-string (coerce num 'double-float)))
+    (number
+     (float-to-sql-string num))))
 
 (defun float-to-sql-string (num)
   "Convert exponent character for SQL"