mailr12048 - /branches/bieri_gui/gui_bieri/misc.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 30, 2010 - 22:36:
Author: bugman
Date: Thu Dec 30 22:36:23 2010
New Revision: 12048

URL: http://svn.gna.org/viewcvs/relax?rev=12048&view=rev
Log:
Created the gui_to_float() function to convert GUI unicode data to floats.


Modified:
    branches/bieri_gui/gui_bieri/misc.py

Modified: branches/bieri_gui/gui_bieri/misc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/misc.py?rev=12048&r1=12047&r2=12048&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/misc.py (original)
+++ branches/bieri_gui/gui_bieri/misc.py Thu Dec 30 22:36:23 2010
@@ -54,6 +54,23 @@
 
     # Return the float.
     return result
+
+
+def gui_to_float(string):
+    """Convert the GUI obtained string to an float.
+
+    @param string:  The number in string form.
+    @type string:   str
+    @return:        The float
+    @rtype:         float or None
+    """
+
+    # No input.
+    if string == '':
+        return None
+
+    # Convert.
+    return float(string)
 
 
 def gui_to_int(string):




Related Messages


Powered by MHonArc, Updated Thu Dec 30 23:00:01 2010