mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
fixed remap() type to int
This commit is contained in:
parent
ae9650b9ee
commit
93a57e5e37
@ -34,7 +34,7 @@ from typing import TypeVar
|
|||||||
|
|
||||||
# =====
|
# =====
|
||||||
def remap(value: int, in_min: int, in_max: int, out_min: int, out_max: int) -> int:
|
def remap(value: int, in_min: int, in_max: int, out_min: int, out_max: int) -> int:
|
||||||
return (value - in_min) * (out_max - out_min) // (in_max - in_min) + out_min
|
return int((value - in_min) * (out_max - out_min) // (in_max - in_min) + out_min)
|
||||||
|
|
||||||
|
|
||||||
# =====
|
# =====
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user