# how to use decimal deviding in c#, for counting prosent used of transactions in my case....

i am creating a function to count prosent used transaction in my program, i am getting total prosent to be example: 0,673 , but i want it to be int,   6 %  prosent.....

``````int MaxTrans;
int UsedTrans;
decimal Totalt;
Totalt = Decimal.Divide(UsedTrans * 100 , MaxTrans);
// Totalt =  (UsedTrans * 100) ,MaxTrans;
if (Totalt <= 6)
{
MainForm.RunningForm.FadeIn(GetValue("usedTransactions") + " " + UsedTrans + " " + GetValue("usedOf") + " " + MaxTrans,
GetValue("tranLeft") + " " + Totalt + " " + GetValue("tranLeft1"), 16000);
}
``````
###### Who is Participating?

Totalt = Decimal.Divide(UsedTrans * 100 , MaxTrans) // is multiplying by 100 on purpose?

if yes,
Totalt = Decimal.Divide(UsedTrans * 100 , MaxTrans) * 10; // to get 6 from 0.673

if no,
Totalt = Decimal.Divide(UsedTrans, MaxTrans) * 100; // ( UsedTrans / MaxTrans ) * 100 [percentage of used trans]

int percent = Convert.ToInt32(Totalt); // to remove decimal points..
0

Author Commented:
can somone help me with this issue, i want to int and not a double result....

from 0,673 i want it to be like 6%...
0

Author Commented:
thanks alot, excelent ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.