Skip to content

Commit efd06ef

Browse files
committed
float format fix
1 parent b7a2c1a commit efd06ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xlsx2csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ def handleCharData(self, data):
911911
# repr(float(...)) - workaround to correctly round precision for floats
912912
# repr gives same result on python 2 and 3, while str is different on python 2
913913
self.data = "%i" % Decimal(repr(float(self.data)))
914-
elif ('E' in self.data or 'e' in self.data):
914+
elif ('E' in self.data or 'e' in self.data) or self.floatformat:
915915
self.data = str(self.floatformat or '%f') % data
916916
# if cell is general, be aggressive about stripping any trailing 0s, decimal points, etc.
917917
elif format_str == 'general':

0 commit comments

Comments
 (0)