Number field and agent

Hello.I’m having a weird problem.

On a form, I have some number fields: amount_1, amount_2, amount_3 and total.

The formula for the total field is:

@Round(amount_1+amount_2+amount_3;0,01)

The problem is that it does not display the total until you open the doc and save it or refresh it.

Now there is a formula agent that updates all the docs with the form and I tried to put the formula that calculates the total in it.

At the end I’ve put:

tot := amount_1+amount_2+amount_3;

Field total := @Round(tot;0,01)

but in the field total I get:

“ERROR: Incorrect data type for operator or @Function: Number expected”

The weird thing is that when I put the same code in a button on the form, it sets the value of the field correctly!

I have tried using

tot := @tonumber(amount_1)+@tonumber(amount_2)+@tonumber(amount_3);

Field total := @Round(tot;0,01)

…I don’t get the incorrect data type error when I run the agent but the total is now empty…

Does anybody have any idea about the cause of this problem and possible solution(s) please?

Subject: Number field and agent

One or more of the number fields contains text, not a number.

If you open the document though its form, the field properties that are set will kick in and convert the value to number automatically. However, at some point in the past, documents have been created either with a different form (or differently configured fields on the form) or by some agent, that did not set the field type to number correctly.

Subject: RE: Number field and agent

Thanks a lot Mr Meliantrop…again