Skip to content

Commit

Permalink
fix to_best_unit?
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Oct 31, 2024
1 parent c862724 commit 7e8aab4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sizebot/lib/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ async def convert(cls: Type[DimType], ctx: BotContext, argument: str) -> DimType
def get_quantity_pair(cls, s: str) -> tuple[str | None, str | None]:
raise NotImplementedError

def to_best_unit(self, sysname: str) -> str:
def to_best_unit(self, sysname: str, spec: str = "", preferName: bool = False) -> str:
value = Decimal(self)
system = self._systems[sysname]
unit = system.get_best_unit(value)
return unit.format(value)
return unit.format(value, spec, preferName)

@classmethod
def load_from_file(cls, filename: str):
Expand Down

0 comments on commit 7e8aab4

Please sign in to comment.