Merged Rolf Schmidt's illysam branch
[hooke.git] / hooke / ui / gui / prettyformat.py
similarity index 84%
rename from lib/prettyformat.py
rename to hooke/ui/gui/prettyformat.py
index 09f98b07ab8fae673e71b78fc4a8e55cd84df6f8..0c0a662bdf1d87d7fbde8fa52730469d95d10bf2 100644 (file)
@@ -1,28 +1,12 @@
-#!/usr/bin/env python\r
+# Copyright\r
 \r
-'''\r
-prettyformat.py\r
-\r
-Simple Python function to format values with nice prefixes\r
-Version 1.0.1\r
-\r
-History\r
-2009 07 16: added negative number support\r
-            added decimal-formatted output\r
-2010 02 25: renamed variables to a more pythonic style\r
-            added whitespace stripping option to prettyformat()\r
-            added get_multiplier()\r
-            added get_exponent()\r
-            updated examples\r
-\r
-Copyright 2009 by Dr. Rolf Schmidt (Concordia University, Canada)\r
-\r
-This program is released under the GNU General Public License version 2.\r
-'''\r
+"""Simple Python function to format values with nice prefixes.\r
+"""\r
 \r
 import math\r
 from numpy import isnan\r
 \r
+\r
 def pretty_format(value, unit='', decimals=-1, multiplier=0, leading_spaces=False):\r
     if value == 0:\r
         return '0'\r
@@ -155,4 +139,4 @@ decimals=3
 for aValue in scale_values: print decimalFormat(aValue/multiplier, decimals),\r
 #print the scale label using the value at index\r
 print '\n'+get_prefix(scale_values[index])+'N'\r
-'''
\ No newline at end of file
+'''\r