Skip to content
Error when accessing replit database in python
Profile icon
ZoutigeWolf

Whenever i try to access my database with value = db["key"] I get the error TypeError: unexpected type "float".

This never happened before, can someone tell me what this means?

the file with problems = cogs/xp.py

You are viewing a single comment. View All
Profile icon
ZoutigeWolf

@Coder100
I found the solution, apparently a dict in the database can't have a float as a value.
The xp is normally an int but the multiplier made it a float so i now round that to an int.
And I now store the multipliers as a string which i can later convert back to a float