how to get numbers below 0 from OBJ_EDIT

 

Hi there, What i want to do is getting numbers like 0.1, 0.2, 0.3 from OBJ_EDIT, but it seems to only return 0 and leaving everyother text after the 0. Any help rectifing this. thank in advance.

ObjectCreate(_Symbol, "LOTEDIT", OBJ_EDIT, 0,0,0);
        ObjectSetInteger(_Symbol, "LOTEDIT", OBJPROP_CORNER, 4);
       ObjectSetInteger(_Symbol, "LOTEDIT", OBJPROP_XDISTANCE, 10);
       ObjectSetInteger(_Symbol, "LOTEDIT", OBJPROP_XSIZE, 90);
       ObjectSetInteger(_Symbol, "LOTEDIT", OBJPROP_YDISTANCE, 70);
       ObjectSetInteger(_Symbol, "LOTEDIT", OBJPROP_YSIZE, 30);
       ObjectSetString(_Symbol, "LOTEDIT", OBJPROP_TEXT, MinLot);

/////////////////function

 void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam){

         if( id == CHARTEVENT_OBJECT_CLICK){
            if(sparam == "BUYBUTTON"){
                  int LOTTOBUY = ObjectGetString(_Symbol, "LOTEDIT", OBJPROP_TEXT);
                  if(NOOFTRADE >= 1){
                        ObjectSetString(0, "INFOTEXT", OBJPROP_TEXT, LOTTOBUY+ " BUY TRADE ENTERED");
                        buyTrade();
                        PlaySound("ok.wav");
                 }
}


whenever this code is been ran, any number above 0 is been accepted. Let say i want to open 0.01 lot size and i input 0.01 in the OBJ_EDIT ("LOTEDIT") it always return 0 leaving out the .01 hence making it an invaid lot size enty. hope my problem is been understood. any help please?

 
yomadestephens:
Hi there, What i want to do is getting numbers like 0.1, 0.2, 0.3 from OBJ_EDIT, but it seems to only return 0 and leaving everyother text after the 0. Any help rectifing this. thank in advance.
Show your code if you want some help otherwise we can’t see your errors 
And what numbers do you mean the text value, coordinates or what ?
 

Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
          General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
          Messages Editor

 
yomadestephens:

Hi there, What i want to do is getting numbers like 0.1, 0.2, 0.3 from OBJ_EDIT, but it seems to only return 0 and leaving everyother text after the 0. Any help rectifing this. thank in advance.


whenever this code is been ran, any number above 0 is been accepted. Let say i want to open 0.01 lot size and i input 0.01 in the OBJ_EDIT ("LOTEDIT") it always return 0 leaving out the .01 hence making it an invaid lot size enty. hope my problem is been understood. any help please?

Don’t use an integer variable to get a string
 
Paul Anscombe #:
Don’t use an integer variable to get a string
Thanks for the advise, didnt think that through. all done.
 
yomadestephens #:
Thanks for the advise, didnt think that through. all done.
You’re welcome