Getting double value from textbox

 
When i extract a value from a textbox using:
 Value = DoubleToString(ObjectGetString(0, OBJPROP_TOOLTIP, 0)) 
It works fine when you convert it to a double and print it. However, when i try to add 0.5 to the value, i get incorrect results. For example, the result of Value + 0.5 is 50.05 instead of the expected 5.5.

Improperly formatted code edited by moderator. Please use the CODE button (Alt-S) when inserting code.

Code button in editor

 

The function ObjectGetString returns a string, not a double, just as the function name states.

By using DoubleToString, you are doing repeated conversions, from a string, to a double, to a string, and probably to a double again if the variable "value" is a double.

Assuming the tooltip text does in fact contain a numerical value, then consider one of the following options following ...

double value = StringToDouble( ObjectGetString( 0, OBJPROP_TOOLTIP, 0 ) );
double value = (double) ObjectGetString( 0, OBJPROP_TOOLTIP, 0 );

Regarding the rest of your issue, you have not shown the relevant code, so we can only guess.