How to compute and display value of some fields?
Have a look at the (fairly new) Math Field module (for D7). Some more details about this module (from its project page), which also details when the calculations actually happen:


  The Math Field module defines a new field type to dynamically calculate values on entity forms. This is an alternative to Computed Field
  that does not require the use of PHP Filter.
  
  Math expression fields are dynamically updated via ajax on the entity form as soon as all necessary fields are populated. If JavaScript is disabled, the field will be evaluated when the form is submitted. The result is stored in the database when the form is submitted.


For more details (step-by-step instructions), refer to either of these links:


the (amazing!) Community documentation about the Math Field module.
the interesting article about Introducing the Math Field module, which also includes some screenprints to see it at work (such as the the add/edit form example).


Bonus: you would not need the "PHP filter" (IMO only that should be a valid reason to investigate this alternative) ...