Speed ups to the comma/decimal handing problem

svn: r482
This commit is contained in:
Don Allingham 2001-10-19 00:11:06 +00:00
parent 3ac7238d7a
commit c99d7472a0

View File

@ -125,10 +125,11 @@ else:
#
#
#-------------------------------------------------------------------------
def txt2fl(st):
if _use_comma:
if _use_comma:
def txt2fl(st):
return string.atof(string.replace(st,'.',','))
else:
else:
def txt2fl(st):
return string.atof(string.replace(st,',','.'))
#-------------------------------------------------------------------------
@ -136,8 +137,12 @@ def txt2fl(st):
#
#
#-------------------------------------------------------------------------
def fl2txt(fmt,val):
if _use_comma:
def fl2txt(fmt,val):
return string.replace(fmt % val, ',', '.')
else:
def fl2txt(fmt,val):
return fmt % val
#-------------------------------------------------------------------------
#