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

**URL:** <https://forum.inductiveautomation.com/t/float-does-not-work-with-numbers-over-1-000/7391>\
**Category:** Ignition\
**Created:** [October 9, 2013, 2:55pm UTC](https://forum.inductiveautomation.com/t/float-does-not-work-with-numbers-over-1-000/7391 "2013-10-09T14:55:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdana](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jdana](https://forum.inductiveautomation.com/u/jdana)\
**Post date:** [October 9, 2013, 2:55pm UTC](https://forum.inductiveautomation.com/t/float-does-not-work-with-numbers-over-1-000/7391/1 "2013-10-09T14:55:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [October 9, 2013, 3:13pm UTC](https://forum.inductiveautomation.com/t/float-does-not-work-with-numbers-over-1-000/7391/2 "2013-10-09T15:13:42Z")

</div>

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)`
