Calculation for a Discount Unit Price.

I need a calculation that would take Unit Price and either multiple or subtract the Discount Amount, based off it being a percent or dollar amount, that returns me the discounted unit price. Can anyone help me? I know its probably an ifElse but haven't quite figured it out. Thanks!