Thanks Patick,
I have managed to make it work by adding a dummy column to the return data, I am then able iterate through all rows and perform the math and set the dummy column value during the changed event. This work perfectly when the form is not host within sharepoint. As soon as it is hosted in Sharepoint the Changed event does not seem to fire, as the code that updates the text box does not run.
very frustrating.