Skip to content

Commit b4b82a6

Browse files
authored
Merge pull request #2672 from opentensor/fix/thewhaleking/str-formatting-for-alpha
Alpha str formatting
2 parents c8a570a + cfa3efd commit b4b82a6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bittensor/utils/balance.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ def __float__(self):
5353
return self.tao
5454

5555
def __str__(self):
56-
"""Returns the Balance object as a string in the format "symbolvalue", where the value is in tao."""
57-
return f"{self.unit}{float(self.tao):,.9f}"
56+
"""
57+
Returns the Balance object as a string in the format "symbolvalue", where the value is in tao.
58+
"""
59+
if self.unit == units[0]:
60+
return f"{self.unit}{float(self.tao):,.9f}"
61+
else:
62+
return f"\u200e{float(self.tao):,.9f}{self.unit}\u200e"
5863

5964
def __rich__(self):
6065
int_tao, fract_tao = format(float(self.tao), "f").split(".")

0 commit comments

Comments
 (0)