How to create Custom script to multiply quantity * price = amount

My code will not work. it is for field.
your request is for grid calculation.
Try below link.