@@ -203,17 +203,7 @@ def parse_row(row_xml_string, book):
203203
204204def parse_cell (cell , book ):
205205 cell .type = parse_cell_type (cell )
206- if cell .column_type == 's' :
207- cell .value = book .shared_strings [int (cell .value )]
208- elif cell .column_type == 'b' :
209- cell .value = (
210- (int (cell .value ) == 1 and "TRUE" ) or
211- (int (cell .value ) == 0 and "FALSE" ) or
212- cell .value )
213- elif cell .column_type == 'n' :
214- parse_cell_value (cell , book )
215- # else
216- # no action
206+ parse_cell_value (cell , book )
217207
218208def parse_cell_type (cell ):
219209 cell_type = None
@@ -233,8 +223,21 @@ def parse_cell_type(cell):
233223 cell_type = "float"
234224 return cell_type
235225
236-
237226def parse_cell_value (cell , book ):
227+ if cell .column_type == 's' :
228+ cell .value = book .shared_strings [int (cell .value )]
229+ elif cell .column_type == 'b' :
230+ cell .value = (
231+ (int (cell .value ) == 1 and "TRUE" ) or
232+ (int (cell .value ) == 0 and "FALSE" ) or
233+ cell .value )
234+ elif cell .column_type == 'n' :
235+ parse_numeric_cell_value (cell , book )
236+ # else
237+ # no action
238+
239+
240+ def parse_numeric_cell_value (cell , book ):
238241 try :
239242 if cell .type == 'date' : # date/time
240243 if book .properties ['date1904' ]:
0 commit comments