I would like to do this simple math problem in C#, is there anyone who can help me?
Number A: Is a monetary value with dollars and cents (eg 199.95)
Number B: Is a numerical percentage value (eg 90%) without the percent sign
My code here returns $17995.50 when the answer I am looking for is $179.95
Expand|Select|Wrap|Line Numbers
- decimal DollarAmt = 199.95;
- int PercentAmt = 90;
- decimal result = DollarAmt * PercentAmt ;
- //returns bad result of 17995.50 - help!
- Response.Write(result);