Fix discount function to handle decimal places correctly.