07-05-2011 05:06 AM
Hi
Is it possible to make a double numeric control have Dynamic Precision?
eg. if the value is 1.0 the control would be 1
but if the value is 1.1 the control would be 1.1.
07-05-2011 05:13 AM
Hi Shako,
The problem will be that most numeric values will not be as simple as that, e.g. instead of 1.1 you might have 1.099999999999999. How will you decide that this number should display with one digit instead of with 15?
Wolfgang
07-05-2011 05:23 AM
Well you would still have a maximum precision which would justify wether to round it or not.
What im really looking for is a double control which would truncate all trailing Zeros?
07-05-2011 05:44 AM
concerning the numeric precision, see here
concerning the dynamic precision, in your callback routine you can multiply the new value by 10 (iteratively in a loop) and see if the remainder is zero. Is so you can adjust the numeric precision of your control using SetCtrlAttribute ( ,,ATTR_PRECISION);
07-05-2011 07:37 AM
Im doing this for some controls.
Is there a way i can make a custom control to do this?