Changeset 1447


Ignore:
Timestamp:
Jul 30, 2014 1:14:01 PM (7 years ago)
Author:
toby
Message:

address strange EPD7.3.2 bug with : in float formatting

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1445 r1447  
    34003400    except:
    34013401        pass
     3402    import platform
     3403    print "Platform info:",sys.platform,platform.architecture()[0],platform.machine()
     3404    #print "wxPython description",wx.PlatformInfo
    34023405    print "This is GSAS-II version:     ",__version__,' revision '+str(GSASIIpath.GetVersionNumber())
    34033406    main() # start the GUI
  • trunk/GSASIIpy3.py

    r1410 r1447  
    1111import GSASIIpath
    1212GSASIIpath.SetVersionNumber("$Revision$")
    13 # de
     13# declare symbol (pi) and functions allowed in expressions
    1414sind = sin = s = lambda x: np.sin(x*np.pi/180.)
    1515cosd = cos = c = lambda x: np.cos(x*np.pi/180.)
     
    7777    else:
    7878        digits = list(maxdigits)
    79     string = ("{:."+str(digits[1])+"f}").format(val).strip() # will standard .f formatting work?
     79    fmt="{:."+str(digits[1])+"f}"
     80    string = fmt.format(float(val)).strip() # will standard .f formatting work?
    8081    if len(string) <= digits[0]:
     82        if ':' in string: # deal with weird bug where a colon pops up in a number when formatting (EPD 7.3.2!)
     83            string = str(val)
    8184        if digits[1] > 0: # strip off extra zeros on right side
    8285            string = string.rstrip('0')
Note: See TracChangeset for help on using the changeset viewer.