The .value attribute of a StatCell may be in one of three states:
If this is a suffix cell in a KeyRow,
the .value attribute is the column
label as a string.
If this is a suffix cell in a PartyHoursRow or CensusRow,
the value is zero initially. If no effort data ever
gets added to it, it will still be zero. In this
state we will display a hyphen to mean unknown data.
If this is a suffix cell in a PartyHoursRow or CensusRow
and there is any data, the .value
attribute will be a positive float. We'll use
Section 58, “statNumber(): Display a float without
too much precision” to display it with a
reasonable amount of precision.
# - - - S t a t C e l l . _ d i s p l a y
def _display(self):
'''Determine text to be displayed.
[ if self.value is a string ->
return self.value
else if self.value <= 0 ->
return '-'
else ->
return self.value as a string, without excessive precision ]
'''
#-- 1
if isinstance(self.value, basestring):
return self.value
elif self.value <= 0.0:
return '-'
else:
return statNumber(self.value)