Error on calulation

hi all,

result :=(Tot )/ (yr)* (fact);

@If((yr = 0) | (yr = " ") | (fact = 0) | (fact = " ") | (Tot = 0) | (Tot = " "); 0;

@If(@Sign(result) = -1;0;@Sign(result) = 0;0;result))

where as:

yr is (number)computed with values 1,2 3, etc i.e difference betwn year

fact is(number)computed with values 1, 2, 1.72, 1.2 etc

tot is (number)computed calculating numbers with decimal value upto 2 pts.

and field (number)computed with the above formula

all field decimal upto 2 level.

now formula has no syntax error but when you open the document it throws a error datatype error: number expected only if you perform any calculation in the result part i.e +,-,/,*

otherwise on assignment it works fine.

thx in adv.

Subject: Error on calulation

Try this:-

result :=(Tot )/ (yr)* (fact);

@If((yr = 0) | (@Trim(@Text(yr)) = “”) | (fact = 0) | (@Trim(@Text(fact)) = “”) | (Tot = 0) | (@Trim(@Text(Tot)) = “”); 0;

@If(@Sign(result) = -1;0;@Sign(result) = 0;0;result))

Subject: RE: Error on calulation

Hi jonno,

it didn’t work that way but some from ur code n little here n there

this worked

thx a lot for replying neways.

result :=(@ToNumber(Tottprice))/(@ToNumber(yr_1)*@ToNumber(factor));

@If((@Trim(@Text(yr_1)) = “”) | (@Trim(@Text(factor)) = “”) | (@Trim(@Text(Tottprice)) = “”); 0;

@If(@Sign(result) = -1| @IsError(result);0;@Sign(result) = 0;0;result))