%.1f of inputted value
#1

hey, how could I get only the %.1f of inputted float value? I want to store the value into a file but with %.1f type, because the value can be set by admin up to more numbers after the point.
Reply
#2

pawn Код:
new Float:limit;
            if(sscanf(inputtext, "f",limit))
            {
                return ShowPlayerDialog(playerid,DIALOG_VDISTANCE,DIALOG_STYLE_INPUT,"Distance settings","Establish vehicle spawn distance limit {FF0000}ERROR","OK","Back");
            }
            INI_Open("Settings.ini");
            INI_WriteFloat("SpawnDistanceLimit",limit);
            INI_Save();
            INI_Close();
            ServerI[SpawnDistanceLimit]=limit;
The value can be i.e 10.45434259 , but I only want to store 10.4 into the file and the variable, I've done this before but I cant remember how..
Reply
#3

I'm using SII, it doesn't have that.
Reply
#4

... and then you can use floatstr to transform the string back into a float value when you load it!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)