Link to home
Start Free TrialLog in
Avatar of adspmo
adspmo

asked on

Unexpected results when adding 2 field values with script

Hi Guys


This is just weird

What the following is doing is putting two values together e.g. 3 +3 =33 not 6 as expected
This just started happening, this was in an existing working script

doc.totalAH_1 = doc.CarriedOverAH_1(0) + doc.AllowanceAH_1(0) 'Calculate the used vacation  days
                                    doc.totalAH_2 = doc.CarriedOverAH_2(0) + doc.AllowanceAH_2(0)  'Calculate the remaining vacation days
Avatar of HemanthaKumar
HemanthaKumar

That says that the two fields are of text and being concatenated

doc.totalAH_1 = @TextToNumber(doc.CarriedOverAH_1(0)) + @TextToNumber(doc.AllowanceAH_1(0)) 'Calculate the used vacation  days
doc.totalAH_2 = @TextToNumber(doc.CarriedOverAH_2(0)) + @TextToNumber(doc.AllowanceAH_2(0))  'Calculate the remaining vacation days

~Hemanth
Avatar of adspmo

ASKER

This in script not formula
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
easy points?