align numeric type right when browsing
authorchriskl <chriskl>
Mon, 11 Aug 2003 04:52:32 +0000 (04:52 +0000)
committerchriskl <chriskl>
Mon, 11 Aug 2003 04:52:32 +0000 (04:52 +0000)
HISTORY
classes/Misc.php

diff --git a/HISTORY b/HISTORY
index 2593a404c08b869feb3623fd416e71ce3bc772c6..9898fac5309803e2d7049c897b8a3a3f7869cdb3 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -23,6 +23,7 @@ Features:
 * Allow renaming table and changing table owner
 * Refresh feature on table browse
 * Support better formatted view dumps in 7.4
+* When browsing data, numeric types are aligned right
 
 Bug Fixes:
 * Lots of NULL value in table dump fixes (XML format changed slightly)
index fb052f91101e41ff5185143cb4fce98e6ff3adf9..24a45bcfce8165800e9dd5cebe15958e80a5ae51 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.39 2003/08/06 07:04:44 chriskl Exp $
+        * $Id: Misc.php,v 1.40 2003/08/11 04:52:32 chriskl Exp $
         */
         
        class Misc {
                 */
                function printVal($str, $shownull = false, $type = null) {
                        global $lang;
-                       
+
                        // If the string contains at least one instance of >1 space in a row, a tab character, a
                        // space at the start of a line, or a space at the start of the whole string then
                        // substitute all spaces for &nbsp;s
                        if ($str === null && $shownull) return '<i>NULL</i>';
                        else {
                                switch ($type) {
+                                       case 'int2':
+                                       case 'int4':
+                                       case 'int8':
+                                       case 'float4':
+                                       case 'float8':
+                                       case 'money':
+                                       case 'numeric':
+                                       case 'oid':
+                                               return "<div align=\"right\">" . nl2br(htmlspecialchars($str)) . "</div>";
+                                               break;
                                        case 'bool':
                                        case 'boolean':
                                                if ($str == 't') return $lang['strtrue'];