mohland/dogetipbot — pull request #6 by renfredxh (2014-01-25 18:51:19+00:00)
Title: Remove inaccurate fiat display from message

The fiat conversion is sometimes inaccurate in the balance display. Specifically it is sometimes displayed as $0.0 when it is actually supposed to be a value higher than $0. This could be caused by an error where the conversion rates cannot be fetched, so I made a change in the template that hides the fiat value if it is $0 which I would figure is better than showing it incorrectly.

Example:
```python
t = Template("you have received a __{{ coinval_fmt }}{{ ' (%s)' % fiatval_fmt if fiatval }}__ tip")
# Fiat value is legit, go ahead and display it.
>>> t.render(coinval_fmt='Ð500 Dogecoin', fiatval_fmt='$0.060', fiatval=0.06)
'you have received a __Ð500 Dogecoin ($0.060)__ tip'
# Error getting fiat value, don't show.
>>> t.render(coinval_fmt='Ð500 Dogecoin', fiatval_fmt='$0.060', fiatval=0.0)
'you have received a __Ð500 Dogecoin__ tip'
```