Skip to content

Commit

Permalink
Issue #23
Browse files Browse the repository at this point in the history
Restore the method that detects numeric and non-numeric values.
  • Loading branch information
akey7 committed Oct 22, 2019
1 parent 4afb039 commit 2c2b67d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions landbosse/excelio/XlsxGenerator.py
Expand Up @@ -190,3 +190,21 @@ def tab_details(self, rows):
worksheet.write(row_idx + 1, 5, row['last_number'], self.scientific_format)

worksheet.freeze_panes(1, 0) # Freeze the first row.

def _is_numeric(self, value):
"""
Parameters
----------
value
The value to be tested.
Returns
-------
bool
True if the value is numeric, False otherwise.
"""
try:
float(value)
except ValueError:
return False
return True

0 comments on commit 2c2b67d

Please sign in to comment.