How to perform calculation in the form