How to calculate field value in a form

I am designing a form for data entry which has multiple fields.
I need value of field ‘Machine Efficiency’ to be calculated on the field ‘Machine target’ and ‘Qty’…calculation is below

Machine efficiency = Machine target *100/Qty

Kindly help on how to do this

By using custom script you can calculate the fields value.
Refer link for some examples of custom script -
http://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/

Thanks, Priya