14.08.2011, 18:56
The Value you have divided by 100 and then multiplied by how much percent you want.
(Value / 100) * %
> You have 10,500 $
> You want it's 18%
> Use this: (10500/100) x 18
= 1,890$
> You have 1,457,811 $
> You want it's 56%
> Use: (1457811/100) x 56
= 816,374$
(Value / 100) * %
> You have 10,500 $
> You want it's 18%
> Use this: (10500/100) x 18
= 1,890$
> You have 1,457,811 $
> You want it's 56%
> Use: (1457811/100) x 56
= 816,374$
pawn Код:
stock ToPercentage(value, percentage)
{ return (value/100)*percentage; }
//Now you can use ToPercentage(5500, 15);
//It will return 15% of 5,500