if value should be float but is not, show 'Non applicable'

This commit is contained in:
Benjamin Dauvergne 2016-07-22 16:14:46 +02:00
parent 69fb738818
commit 4a6b6e0471
1 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,10 @@ class CubeMixin(object):
for cell, value in row:
if stringify and cell.type is float:
# FIXME find how to format decimal number using locale with Django
value = ('%05.2f' % float(value)).replace('.', ',') + u' %'
try:
value = ('%05.2f' % float(value)).replace('.', ',') + u' %'
except:
value = _('Non applicable')
if isinstance(value, datetime.timedelta):
if stringify:
s = ''