Cast to float

This commit is contained in:
Jimmy 2022-11-17 19:37:16 +13:00
parent 5742eaf275
commit e39c77807c
1 changed files with 3 additions and 3 deletions

View File

@ -43,10 +43,10 @@ async def run_test():
if "text" in j and "result" in j:
n = 0
for word in j["result"]:
n += int(word["conf"])
if int(word["conf"]) > 0.7:
n += float(word["conf"])
if float(word["conf"]) > 0.7:
print(colored(word["word"], "green"), end=" ")
elif int(word["conf"]) > 0.7:
elif float(word["conf"]) > 0.5:
print(colored(word["word"], "yellow"), end=" ")
else:
print(colored(word["word"], "red"), end=" ")