Skip to content

Threshold spinner in preferences loses precision

In some cases the precision of the JSpinner's stepsize of 0.01 is lost in the preferences for the threshold values.

For example when changing the entropy threshold value from 0.03 to 0.02 by using the JSpinner, instead of the expected 0.02 the spinner value returns 0.01999999997 (so it is a bug of the underlying JSpinnerModel of the JDK).

As a solution we implement a wrapper method that corrects the 0.01999997 back to 0.02 (we need a precision of two decimals only).