mirror of https://github.com/aristocratos/bpytop
Fixed decimal placement in floating_humanizer() function
parent
4aaba39784
commit
fbfd7c3721
|
@ -4449,9 +4449,10 @@ def floating_humanizer(value: Union[float, int], bit: bool = False, per_second:
|
||||||
break
|
break
|
||||||
selector += 1
|
selector += 1
|
||||||
else:
|
else:
|
||||||
if len(f'{value}') < 5 and len(f'{value}') >= 2 and selector > 0:
|
if len(f'{value}') == 4 and selector > 0:
|
||||||
decimals = 5 - len(f'{value}')
|
out = f'{value}'[:-2] + "." + f'{value}'[-2]
|
||||||
out = f'{value}'[:-2] + "." + f'{value}'[-decimals:]
|
elif len(f'{value}') == 3 and selector > 0:
|
||||||
|
out = f'{value}'[:-2] + "." + f'{value}'[-2:]
|
||||||
elif len(f'{value}') >= 2:
|
elif len(f'{value}') >= 2:
|
||||||
out = f'{value}'[:-2]
|
out = f'{value}'[:-2]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue