diff --git a/twander.py b/twander.py index d4db77c..b1bdc5a 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.225 2009/06/27 22:17:56 tundra Exp $" +RCSID = "$Id: twander.py,v 3.226 2009/06/28 05:35:56 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -306,6 +306,7 @@ NONAVIGATE = False # True means that all directory navigation is prevented QUOTECHAR = '\"' # Character to use when quoting Built-In Variables REFRESHINT = 5000 # Interval (ms) for automatic refresh +SCALEPRECISION = 1 # Precision of scaled length representation SORTBYFIELD = "Name" # Field to use as sort key SORTREVERSE = False # Reverse specified sort order? SORTSEPARATE = True # Separate Directories and Files in sorted displays? @@ -1078,11 +1079,17 @@ norms = (1, "") # Scale the results and convert into a string + # displaying SCALEPRECISION worth of digits to + # the right of the decimal point + sep = "" + if SCALEPRECISION: + sep = "." + factor = norms[0] if (factor > 1): - flen = float(flen)/factor - flen = "%.1f" % flen + l, r = str(float(flen)/factor).split(".") + flen = l + sep + r[:SCALEPRECISION] else: flen = str(flen) @@ -5438,7 +5445,7 @@ UI.OptionsNumeric = {"AFTERWAIT":AFTERWAIT,"DEBUGLEVEL":DEBUGLEVEL, "FSZ":FSZ, "MFSZ":MFSZ, "HFSZ":HFSZ, "HEIGHT":HEIGHT, "MAXMENU":MAXMENU, "MAXMENUBUF":MAXMENUBUF, "MAXNESTING":MAXNESTING, - "REFRESHINT":REFRESHINT, "STARTX":STARTX, "STARTY":STARTY, "WIDTH":WIDTH} + "REFRESHINT":REFRESHINT, "SCALEPRECISION":SCALEPRECISION, "STARTX":STARTX, "STARTY":STARTY, "WIDTH":WIDTH} UI.OptionsString = {"BCOLOR":BCOLOR, "FCOLOR":FCOLOR, "FNAME":FNAME, "FWT":FWT, # Main Font/Colors "MBCOLOR":MBCOLOR, "MFCOLOR":MFCOLOR, "MFNAME":MFNAME, "MFWT":MFWT, # Menu Font/Colors