Skip to content

Commit

Permalink
for calendar autoplot, print zeros as '0', not '0.00'
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Jul 16, 2017
1 parent d234c86 commit 2a25ee8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions htdocs/plotting/auto/scripts/p82.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ def get_description():


def safe(row, varname):
"""Safe conversion of value for printing as a string"""
val = row[varname]
if val is None:
return 'M'
if varname == 'pday':
if val == 0.0001:
return 'T'
if val == 0:
return '0'
return "%.2f" % (val,)
return '%.0f' % (val,)

Expand Down

0 comments on commit 2a25ee8

Please sign in to comment.