Calculated Revenue Line Item Amount - How to edit it?

Hello Devs! 

In this ocassion I am seeking for your help on behalf the Revenue Line Item (RLI) Calculated Amount. 

I have this project where I want to have the RLI Calculated Amout given by the next fields:

- Discount (D)

- Quantity. (Q)

- Unit price. (UP)

- Months of service. (MoS)

- Profit Margin. (PM)

To calculate the total (Calculated Amount) the orden of the operations goes like this:

1. Unit Price times the Quatity.

2. (Unit Price times the Quatity) times Months of the service. 

3. ((Unit Price times the Quatity) times Months of the service) times Discount.

4. (((Unit Price times the Quatity) times Months of the service) times Discount) times Profit Margin. 

Resulting in the next formula: 

(((UP x Q) x MoS) x D) x PM)

Obviously I will add the custom fields, that are going to be integer custom fields but I do not know how to edit/read the formula. 

Thanks in advance and please ask for anything that could add to help me explain what I desire to do. 

Best regards, 

Angel Ruiz

Unified Impact