Rounding numbers
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
If you only want the player to withdraw multipliers of 100, this may work:
pawn Код:
new
    multiplier = (balance - (balance % 100)) / 100),
    maxamount = (balance >= 100) ? multiplier * 100 : balance;
Thats one rounded too much on the first line.

Use Babul's method, you could say it is much faster than operating with strings.
Reply


Messages In This Thread
Rounding numbers - by Luis- - 20.11.2011, 15:13
Re: Rounding numbers - by .:Kaos:. - 20.11.2011, 15:15
AW: Rounding numbers - by Babul - 20.11.2011, 15:18
Re: Rounding numbers - by Vince - 20.11.2011, 15:19
Re: Rounding numbers - by Ash. - 20.11.2011, 15:37
Re: Rounding numbers - by AndreT - 20.11.2011, 15:45
Re: Rounding numbers - by Luis- - 20.11.2011, 16:04
Re: Rounding numbers - by Finn - 20.11.2011, 16:13

Forum Jump:


Users browsing this thread: 1 Guest(s)