Float() does not work with numbers over 1,000

In a button event handler I was converting the .text value of a button to a float.

It errored when I was doing the equivalent of float(“1,000”) and was fine on anything without a comma.

Ultimately I just referenced the tag value using tag.read rather than the .text value. It seems like the float() function would be smart enough to ignore the commas.

It sounds like you are using Python to convert this string to a float. Unfortunately Python’s float() conversion doesn’t like commas, but you could always remove them.text = "1,000.93" newText = text.replace(",", "") print float(newText)