pyslha.py

changeset 213
11aef4bd7802
parent 212
3a6db3deedef
child 214
fa07ed634b18
equal deleted inserted replaced
212:3a6db3deedef 213:11aef4bd7802
77 return var 77 return var
78 78
79 def _autostr(var, precision=8): 79 def _autostr(var, precision=8):
80 """Automatically format numerical types as the right sort of string.""" 80 """Automatically format numerical types as the right sort of string."""
81 if type(var) is float: 81 if type(var) is float:
82 return ("%." + str(precision) + "e") % var 82 return ("% ." + str(precision) + "e") % var
83 return str(var) 83 return str(var)
84 84
85 85
86 class AccessError(Exception): 86 class AccessError(Exception):
87 "Exception object to be raised when a SLHA block is accessed in an invalid way" 87 "Exception object to be raised when a SLHA block is accessed in an invalid way"

mercurial