Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bittensor/utils/balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ def __float__(self):
return self.tao

def __str__(self):
"""Returns the Balance object as a string in the format "symbolvalue", where the value is in tao."""
return f"{self.unit}{float(self.tao):,.9f}"
"""
Returns the Balance object as a string in the format "symbolvalue", where the value is in tao.
"""
if self.unit == units[0]:
return f"{self.unit}{float(self.tao):,.9f}"
else:
return f"\u200e{float(self.tao):,.9f}{self.unit}\u200e"

def __rich__(self):
int_tao, fract_tao = format(float(self.tao), "f").split(".")
Expand Down
Loading