Jason Livengood
asked on
Trying to round a quotient down
I am dividing two decimals. I need the quotient to always round down.Also, the resulting quotient should be a whole number integer. Currently I can make the quotient round to the nearest whole number (int numoftwenties = (int)Math.Round((decimal)c hange /20.00m);, but I need it round down. I am trying to calculate the number of twenty dollar bills that would be given back as change to a customer.
For example if a customer was to receive 95.00 dollars in change back. They would receive 4 (not 5)twenty dollar bills back.
For example if a customer was to receive 95.00 dollars in change back. They would receive 4 (not 5)twenty dollar bills back.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
int numoftwenties = (int)change / (int)20;