[Avida-cvs] [Avida2-svn] r128 - trunk/source/python/AvidaGui2

baerb at myxo.css.msu.edu baerb at myxo.css.msu.edu
Fri Apr 8 07:53:35 PDT 2005


Author: baerb
Date: 2005-04-08 10:53:35 -0400 (Fri, 08 Apr 2005)
New Revision: 128

Modified:
   trunk/source/python/AvidaGui2/pyGradientScaleView.py
Log:
Change scale so it doesn't show sci. notation for numbers below 10,000



Modified: trunk/source/python/AvidaGui2/pyGradientScaleView.py
===================================================================
--- trunk/source/python/AvidaGui2/pyGradientScaleView.py	2005-04-08 03:10:37 UTC (rev 127)
+++ trunk/source/python/AvidaGui2/pyGradientScaleView.py	2005-04-08 14:53:35 UTC (rev 128)
@@ -1,13 +1,10 @@
 # -*- coding: utf-8 -*-
 
-# Form implementation generated from reading ui file '/Users/kaben/Projects/Software/Avida/svn/avida2/trunk/source/python/AvidaGui2/pyGradientScaleView.ui'
+# Original form implementation generated from reading ui file 
+# '/Users/kaben/Projects/Software/Avida/svn/avida2/trunk/source/python/AvidaGui2/pyGradientScaleView.ui'
 #
-# Created: Thu Mar 31 16:57:36 2005
-#      by: The PyQt User Interface Compiler (pyuic) 3.13
-#
-# WARNING! All changes made in this file will be lost!
+# It has since been modified by hand
 
-
 from qt import *
 from math import exp
 
@@ -163,4 +160,12 @@
     self.setMinimumHeight(h)
 
   def getLabelString(self, x):
-    return QString("%1").arg(x, 0, 'g', 2)
+
+    # To show numbers < 10,000 without going to sci. notation had to
+    # set precision in the .arg method to 5 this produces a lot of digits
+    # after the decimal point so the follow lines partially correct for this
+
+    if x >= 100:
+      ix = int(x)
+      x = float(ix)
+    return QString("%1").arg(x, 0, 'g', 5)




More information about the Avida-cvs mailing list