Source code for nqs_sdk.tools
from decimal import Decimal
from typing import Any
[docs]
def to_int(n: Any) -> int:
try:
return int(n, 0)
except TypeError:
if isinstance(n, int):
return n
else:
return 0