Solved

Unexpected results when adding 2 field values with script

Posted on 2003-12-04
4
213 Views
Last Modified: 2013-12-18
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
0
Comment
Question by:adspmo
  • 2
4 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9876495
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
0
 

Author Comment

by:adspmo
ID: 9876502
This in script not formula
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 300 total points
ID: 9876561
oh I totally missed to see doc.

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

Expert Comment

by:madheeswar
ID: 9880940
easy points?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Lotus notes email code 13 88
Lotus Domino server 9 7 64
Using @Prompt in a Queryclose Event 14 79
attaching a file lotus notes 4 98
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now