Changeset 33249


Ignore:
Timestamp:
2019-06-27T23:21:50+12:00 (5 years ago)
Author:
davidb
Message:

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

File:
1 edited

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       
Note: See TracChangeset for help on using the changeset viewer.