Changeset 33249

Show
Ignore:
Timestamp:
27.06.2019 23:21:50 (4 weeks ago)
Author:
davidb
Message:

Further checking needed when converting cell-value to be in unicode format

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/prepare/xlsutil.py

    r33222 r33249  
    1414    if type(value) != unicode: 
    1515        value_str = value 
    16         if type(value_str) != str: 
     16        if type(value) != str: 
     17 
     18            # numbers in the spreadsheet default to 'float' 
     19            # but if actually a whole number, want it be 
     20            # type cast to an 'int' otherwise a '.0' ends 
     21            # up on the end of the string version 
     22            if type(value) is float: 
     23                if value == int(value):  
     24                    value = int(value) 
     25 
    1726            value_str = str(value) 
    1827