steinm          Thu Nov 27 06:32:06 2003 EDT

  Modified files:              
    /php-src/ext/dbase  dbase.c 
  Log:
  - set precision to 0 unless the field is of type N or I
  
Index: php-src/ext/dbase/dbase.c
diff -u php-src/ext/dbase/dbase.c:1.70 php-src/ext/dbase/dbase.c:1.71
--- php-src/ext/dbase/dbase.c:1.70      Tue Oct 14 03:49:34 2003
+++ php-src/ext/dbase/dbase.c   Thu Nov 27 06:32:05 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dbase.c,v 1.70 2003/10/14 07:49:34 steinm Exp $ */
+/* $Id: dbase.c,v 1.71 2003/11/27 11:32:05 steinm Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -791,7 +791,14 @@
                add_assoc_long(row, "length", cur_f->db_flen);
                
                /* number of decimals in field */
-               add_assoc_long(row, "precision", cur_f->db_fdc);
+               switch (cur_f->db_type) {
+                       case 'N':
+                       case 'I':
+                               add_assoc_long(row, "precision", cur_f->db_fdc);
+                               break;
+                       default:
+                               add_assoc_long(row, "precision", 0);
+               }
 
                /* format for printing %s etc */
                add_assoc_string(row, "format", cur_f->db_format, 1);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to