counter display

counter display

I am struggling to get a display counter in the form view...

Is it possible to get a display counter...that keeps adding the numeric values of a field to the earlier value, upon user input, and displays the total value as a counter display?

If my fields are Food, Calories. As the user selects a type of Food, and inputs it, the calories keep adding to a counter...which I want displayed...

Any help appreciated.