def numbify(entry, is_int = False):
text = unicode(entry.text()).strip()
+ pos = entry.cursorPosition()
chars = '0123456789'
if not is_int: chars +='.'
s = ''.join([i for i in text if i in chars])
except:
amount = None
entry.setText(s)
+ entry.setCursorPosition(pos)
return amount