Posts: 35
Threads: 9
Joined: Jul 2008
Reputation:
0
Alright, Im trying to load a float from a MySQL table. The MySQL table has the value. When I try to load it by using strval(Field); it returns the value without anything beyond the decimal point. Example, getting the value 1800.125 from the MySQL table, gives that value 1800.0000. Can someone tell me a solution to this?
Posts: 1,154
Threads: 6
Joined: Aug 2008
Reputation:
0
%.0f will limit it down to 1 decimal point
Posts: 35
Threads: 9
Joined: Jul 2008
Reputation:
0
Trying to assign it to a variable, that has nothing to do with what i'm trying to do. float(strval(Field)); will not work either
Posts: 1,154
Threads: 6
Joined: Aug 2008
Reputation:
0
format(string, sizeof(string), "%.0f", w/e string variable);
new variable = strval(string);
Posts: 35
Threads: 9
Joined: Jul 2008
Reputation:
0
Wrong again, I did some searching, the answer is floatstr(string[]);
Posts: 35
Threads: 9
Joined: Jul 2008
Reputation:
0
I added a word that wasnt needed and it made the search return no results