Updated formatting of total_blocks value (#30170)

The number of total blocks is always a round number. There can't be .1 or .11 blocks for example. The output is now always formatted with two decimals that are always 00.
This commit is contained in:
P-Verbrugge 2019-12-23 21:42:44 +01:00 committed by Fabian Affolter
parent f23cc16660
commit 059e8722b6

View file

@ -148,7 +148,7 @@ class BitcoinSensor(Entity):
elif self.type == "total_btc":
self._state = "{0:.2f}".format(stats.total_btc * 0.00000001)
elif self.type == "total_blocks":
self._state = "{0:.2f}".format(stats.total_blocks)
self._state = "{0:.0f}".format(stats.total_blocks)
elif self.type == "next_retarget":
self._state = "{0:.2f}".format(stats.next_retarget)
elif self.type == "estimated_transaction_volume_usd":