Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Math question 1

Status
Not open for further replies.

cheetahz

Technical User
Dec 4, 2008
101
US
Is it possible to take some numbers from attachmate screen and do math with them?



I will pase them back to a different location
 
great!!
it works but the zero is not being removed
so if i have 100.00 and i subtract the 75.00
the result is 250.00
 


"the zero is not being removed"

Removed from WHAT?

Did you CLEAR the field before putting the string back in it?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
it is tacking on to the front of the numbers as i showed above
 




You know, you are so difficult to correspond with because it's like you only listen or pay attention to the FIRST thing that is posted.

What about the OTHER thing that I posted?


Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
exacltly?
if you look at my post a few back i explain very clear with an example of what it is doing.


if i have 100.00 and then the code runs the answer is 25.00 (right)
well the result is 250.00
so it is taken the two digits(the answer and puting it where the code says to 6, 17 but not in the right format
 


And I posted a solution to that in my recent 13 Feb 09 8:24 post.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
i cant seem to get it formated correctly
now the result is the answer without decemal places

EXAMPLE:
100.00 - 75.00 = 25
 


"now the result is the answer without decemal places"

Is that a problem?

Is 25 not also equal to...

25.0
25.00
25.000

ad nausium?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
wow?
i didn't say they was different amount's

it needs to be the correct "format
 


Why?

Does your system require you to add a decimal point and the "correct" number of meaningless trailing zeros?

What kind of system is that! I have NEVER seen a professional system that has that kind of input requirement! Is that REALLY true???

In the event that it is, guess what? You'll have to format the input to conform, testing the value and conditionally adding decimal point and/or trailing zeros

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
yes.
i know.

i will try to get it formatted correctly.

thanks
 
so when it is 129.95 it is rounding it cant do that.
how do i get it to produce correct results?


thanks
 



Please explain what results you are getting and what resutls you need.

I do not know what "correct" means to you, unless you clearly, concisely and completely explain what you mean.

129.95 looks like a perfectly good number to me.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
yes me to, but once the code runs the result is
55
Instead of 54.95 which is "correct" to me
 




If you are converting to LONG CLng, then your result will be an integer.

You must use CDbl or CSng for floating point precision.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
it isn't working.
i changed all the CLng to CDbl or CSng (tried both) and neither works
the code i have is the code from your post 12 Feb 09 16:50
 


It would have made it simpler for you and me, if you had posted the code in question that you are currently using for the data acquisition, calculation and return.

Every time I have to ask for relevant information. This has been like pulling teeth!

Please think and understand that I cannot see into your head or in your emulator, or code.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
if you read my post i said
"the code i have is the code from your post 12 Feb 09 16:50 "

instead of trying to be, well you know
 


Well if you are using the code from 12 Feb 09 16:50, then you will get results that you do not want.

You had to CHANGE the code from 12 Feb 09 16:50 or it will not work as you intend it to work.

I am being extremely patient, and you are being very difficult!

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top