Sum of two numbers

i want to geT the sum of two numbers from fields example when i input a number from field1 and field2 i want the sum of field 1 and field2 from field3

example

field1 = 2

field2 = 5

field3 = 7

using lotus script,formula,javascript or java

like this thanks

Subject: sum of two numbers

In field3, put formula:

@Sum(field1:field2)

If you want to ensure they are nubmers.

f1:=@TextToNumber(field1);

f2:=@TextToNumber(field2);

@Sum(f1:f2)

Subject: RE: sum of two numbers

where i can paste this code form field3, field2 or field1 i encounter an error

f1:=@TextToNumber(field1);

f2:=@TextToNumber(field2);

@Sum(f1:f2)

thanks

Subject: RE: sum of two numbers

Use @ToNumber instead of @TextToNumber. The code goes in Field3 (the sum field). And if you’re not going to do anything else to educate yourself, at least read the “Application Design” section of Domino Designer Help. Put some effort into it – we all have.

Subject: RE: sum of two numbers

thanks stan rogers for the code

Subject: sum of two numbers

thanks to all people who help how to solve my problem thanks regards

Subject: sum of two numbers

What are you trying to do? In what context.

For example it could be done in the background:

doc.field3(0) = doc.field1(0) + doc.field2(0)

But if you’re dealing with the document in the front end then…

uidoc.fieldSetText(“field3”. Cstr(

Cint(uidoc.fieldgetText(“field1”)) +

Cint(uidoc.fieldgetText(“field2”))

))

You could do all this in a dialog box where two numbers are entered and upon closing the dialogbox the fields are summed.

Of course this also could be done using @functions, and lotus script is not required. The hard part is getting things to refresh.

Remember Lotus Notes is NOT an Excel spreadsheet.

Subject: RE: sum of two numbers

uidoc.fieldSetText(“field3”. Cstr(Cint(uidoc.fieldgetText(“field1”)) +

Cint(uidoc.fieldgetText(“field2”))

))

i have a problem of this code