converting string to int
#4

Quote:
Originally Posted by redigaffix
Посмотреть сообщение
The table has the value 3000 an int, i get it as string "3000" and i convert it to int and then it returns me 3 only. I am studying right now and can't show you the code, but later arriving at home i show you.
If you are 100% sure it's returning '3000' as a string you're probably using strval() incorrectly. Also, make sure the block size for your string is big enough, if you define a string with size 1 it cannot hold more than 1 character.

Example:
pawn Код:
// Good
new string[9]; // Highest number = 999999999

// Bad
new string[1]; // Highest number = 9
Reply


Messages In This Thread
converting string to int - by redigaffix - 09.01.2013, 08:31
Re: converting string to int - by Sinner - 09.01.2013, 08:44
Re: converting string to int - by redigaffix - 09.01.2013, 09:19
Re: converting string to int - by Sinner - 09.01.2013, 10:41
Re: converting string to int - by redigaffix - 09.01.2013, 10:50
Re: converting string to int - by Konstantinos - 09.01.2013, 10:51
Re: converting string to int - by redigaffix - 09.01.2013, 10:54
Re: converting string to int - by redigaffix - 09.01.2013, 12:18

Forum Jump:


Users browsing this thread: 1 Guest(s)