From 059e8722b6af0c289d5455a2a212c56de16f1409 Mon Sep 17 00:00:00 2001 From: P-Verbrugge <41943098+P-Verbrugge@users.noreply.github.com> Date: Mon, 23 Dec 2019 21:42:44 +0100 Subject: [PATCH] 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. --- homeassistant/components/bitcoin/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/bitcoin/sensor.py b/homeassistant/components/bitcoin/sensor.py index b62bb434e85..bc8394d51a5 100644 --- a/homeassistant/components/bitcoin/sensor.py +++ b/homeassistant/components/bitcoin/sensor.py @@ -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": -- GitLab