change vote button width calculation method

This commit is contained in:
rimu 2024-01-11 21:18:34 +13:00
parent 0d9566806e
commit 2faafb01eb

View file

@ -266,10 +266,7 @@ def shorten_url(input: str, max_length=20):
# the number of digits in a number. e.g. 1000 would be 4
def digits(input: int) -> int:
if input == 0:
return 1 # Special case: 0 has 1 digit
else:
return math.floor(math.log10(abs(input))) + 1
return len(shorten_number(input))
@cache.memoize(timeout=50)