BTW, you actually lied in the question, when you wrote var = '2000', because that string does not produce an error. The error happens when the string is var = '2,000', so you should put that in the question. See How to create a Minimal, Complete, and Verifiable example
,in your string, you need to remove it before you can convertvar = '2000', because that string does not produce an error. The error happens when the string isvar = '2,000', so you should put that in the question. See How to create a Minimal, Complete, and Verifiable example