The fundamental issue here is that NSFormatter is not used, so the code relies on the implicit formatting of the text field. When we set the number, like 1000 the text field formats it as 1.000. Now when it changes, it is re-evaluated but now 1.000 is not properly handled because the implicit formatting/parsing is apparently not properly locale-aware, so it fails to parse 1.000 as 1000 but instead treats it as 1.0, resulting in 1 when asked for the integer value.
The solution would be to use a NSFormatter to handle that properly, however this is far from trivial for this piece of code, as it is quite old and was written less than ideal with how the Text field is coupled to the sliders/steppers. It updates these on each change, resulting in the formatter to be invoked for each change, which in turn results in an issue that it is now impossible to enter large digits like 10000 due to the following steps happening:
User types 1000
Change notification handler asks the text field for the int value
Text field invokes formatter to parse the string to an int
In doing so the formatter formats the field as 1.000
So far so good, now with the next key stroke things go really wrong:
User types another 0 resulting in 1.0000
Change notification handler asks the text field for the int value
Text field invokes the formatter to parse the string to an int
Formatter fails to parse 1.0000 as it is not a valid number, as the thousands separator is in an invalid place
Text field is cleared as the formatter could not format the value