Skip to content

Commit 0181ca8

Browse files
authored
Merge pull request #902 from burnash/bugfix/keep_comma_in_str_when_numericise
Bugfix - in numericise do to overwrite original value
2 parents 7046b5d + 2d33fd7 commit 0181ca8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gspread/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,14 @@ def numericise(
134134
value = value.replace("_", "")
135135

136136
# replace coma separating thousands to match python format
137-
value = value.replace(",", "")
137+
cleaned_value = value.replace(",", "")
138138
try:
139-
value = int(value)
139+
int_value = int(cleaned_value)
140+
return int_value
140141
except ValueError:
141142
try:
142-
value = float(value)
143+
float_value = float(cleaned_value)
144+
return float_value
143145
except ValueError:
144146
if value == "":
145147
if empty2zero:

0 commit comments

Comments
 (0)