Add average price function and show result for UI.