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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbers scale and representation

Status
Not open for further replies.

nnzz

Programmer
Feb 26, 2001
8
0
0
ES
Hello,
I've developed an application wich reads files from disk containing Double numbers. I read these numbers as Strings, and then I make a format in the form "0.XXXXXE+-Y" and put the value in Text Boxes. In my PC it works all right (Win 95), but when I install tha application on any other PC (I've tried 3 different PC's, Win 95 and NT), the numbers I read are in a different scale, for example:

the number 0.1234 appears as 1.234, and the number 0.00033521656 as 33521.526 and the number 0.0300 as 0.3

First I treat them as strings, and once I've assured that they are numbers, I convert to Double. As I say in my PC it works and its debugged and tested, so I'm sure the process is right.

Another added problem is that in the other PC's I can only see the exe file, not the source code and I can't modify or debug the code. I've tried changing the Regional Configuration for numbers, such us decimal separator, decimal positions, etc. but no success.

Any tips on what can be the problem?

Thank you.
 
nnzz -

I assume you're running the same input file on both your development machine and production machines? I suspect the layout of the files may be different.

If they're the same, then I'd put a lot of msgbox calls in your program to display relevent values. If you want to leave them in permanently, you can condition them on the Command variable containing "-debug" (you'd run your .exe with this flag when you want to inspect stuff).

Chip H.
 
Yes, the file is the same, actually I choose the file (CommonDlg), and in notepad I see the correct values.

What is the "layout" of the file?

Anyway, I'll try what you say of messages.

many thanks.
 
nnzz -

By "layout", I mean the widths of the data in the file. If you had two files that weren't exactly the same format (the column was 10 chracters wide in one, 8 characters wide in the other), when you read it in, it could cause the behavior you describe. But since you said you've been using the same file on both machines, that's not it. :-I

You might try posting some of your code here for us to look at. Surround it with the TGML "tt" tags so that indention is preserved. (see the "Process TGML" link at the bottom of the screen for a list of all TGML tags)

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top