Solved

Unexpected results when adding 2 field values with script

Posted on 2003-12-04
4
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

724 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