On Click int numeric entry displays decimal

I have a numeric entry field that needs to only accept whole numbers without decimal values. I have selected the format (0,0), but when I click on the numeric field, it displays decimal values.

after click the numeric entry filed

One approach to ensure the value is always an integer would be to add a change script to the value property:

#def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	from org.python.core import PyInteger
	if not isinstance(currentValue.value, PyInteger):
		self.props.value = int(currentValue.value)

I would also set the spinner increment to an integer (Probably 1)

1 Like