Yes I suspected you meant it like that but wasn't sure as you wrote "where to put the minus sign".
Anyhow, being in Adobe LiveCycle Designer, there is a thing called the "Script Editor". If you don't have that showing you can find it by navigating from the top most toolbar -> "Window" and click -> "Script Editor". Alternatively press ctrl+shift+f5.
What you want to do is to link your script to a certain the object (field) and then choose what event it will trigger on (I will try to explain a bit easier later). So for your case:
- Highlight the field you want the script in (in your case it seems like a decimal field in a table).
- Choose the event you want (exit) by opening the dropdown menu in the topleft corner of the script editor and clicking it.
- Simply enter the code Magus wrote above in the text area of the editor.
And then you have it!
So the event is just what it sounds like, an event on which you want something to happen. So for your case what will happen is, the user will enter the decimal field, put in some data and then exit. And then the code you have said should be executed upon the exit event will be executed and do what I tried to explain earlier.
It's quite simple when you get the hang of it, I hope this may help you a bit 
Regards, Mattias