How to get precents of a value?
#5

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$

pawn Код:
stock ToPercentage(value, percentage)
{ return (value/100)*percentage; }

//Now you can use ToPercentage(5500, 15);
//It will return 15% of 5,500
Reply


Messages In This Thread
How to get precents of a value? - by KfirRP - 14.08.2011, 18:45
Re: How to get precents of a value? - by PhoenixB - 14.08.2011, 18:48
Re: How to get precents of a value? - by swieberdevos - 14.08.2011, 18:51
Re: How to get precents of a value? - by antonio112 - 14.08.2011, 18:51
Re: How to get precents of a value? - by iPLEOMAX - 14.08.2011, 18:56
Re: How to get precents of a value? - by KfirRP - 14.08.2011, 19:54

Forum Jump:


Users browsing this thread: 2 Guest(s)