mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
change vote button width calculation method
This commit is contained in:
parent
0d9566806e
commit
2faafb01eb
1 changed files with 1 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue