13.11.2012, 14:38
Hello everyone,
I haven't made any thread for a while because I did not actually have any problem until today.
I tried to fix it, I had some researches on the ******/samp forum but still nothing.
I made a stock that it reads a value from 0 to 2147483647 and it prints according to the digits. For example, if I type 10000000 (which is 10 millions), it will display that it's '10M'. However, if I define the variables and print them, they got printed, unless I use the 'ConvertMoney( value );', which prints only until 1BN (billion). Even if it is 2 billions, it doesn't get printed for an unknown reason.
The results:
It does not work with over 2 billions and the limit is 2147483647, I can't understand why it doesn't work.
I haven't made any thread for a while because I did not actually have any problem until today.
I tried to fix it, I had some researches on the ******/samp forum but still nothing.
I made a stock that it reads a value from 0 to 2147483647 and it prints according to the digits. For example, if I type 10000000 (which is 10 millions), it will display that it's '10M'. However, if I define the variables and print them, they got printed, unless I use the 'ConvertMoney( value );', which prints only until 1BN (billion). Even if it is 2 billions, it doesn't get printed for an unknown reason.
pawn Код:
main( )
{
new
a = 1000000000,
b = 2147483647
;
printf( "a = %d, b = %d", a, b );
printf( "a = %s", ConvertMoney( a ) );
printf( "b = %s", ConvertMoney( b ) );
}
It does not work with over 2 billions and the limit is 2147483647, I can't understand why it doesn't work.
pawn Код:
stock ConvertMoney( value )
{
new
tmp[ 128 ],
val[ 8 ],
val2[ 16 ]
;
if( value >= 0 && value <= 2147483647 )
{
// Converting part
format( tmp, 128, "%s%s", val2, val );
}
else format( tmp, 128, "--" );
return tmp;
}