public final void setDecimals ( final int decimals ) { Condition . INSTANCE . ensureAtLeast ( decimals , 0 , "The decimals must be at least 0" ) ; this . decimals = decimals ; setValue ( roundToDecimals ( getValue ( ) ) ) ; }
Sets the number of decimals of the floating point numbers the preference should allow to choose . If the number of decimals is set to 0 the preference will only allow to choose integer values .