467,117 Members | 1,011 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,117 developers. It's quick & easy.

double.parse(string) gives wrong results on some computers


I developed an application for my study project to do some mathematical calculations.

In this application, I am reading from a text file which contains some numbers.

Now the problem is that it works correctly on my system but not on some other systems. When I debugged the application on the system where it was not working I found that the method


is returning wrong results. When the string is "0.8", it returns 8. And similarly all the numbers are missing the decimal.

I developed this application in dot net 3.5.

Somebody pls tell me whats going on. Why it is working on some systems and not on others. What I need to do.
Aug 6 '09 #1
  • viewed: 2576
2 Replies
I found the solution.
The systems where it was not working had German language version of windows XP. And in german language numbers are represented in other format.
134,245.00 in english corresponds to 134.245,00 in german.

stupid vocabulary.
Aug 6 '09 #2
Expert 2GB
Two tips:
1 - When asking a question about why a method doesn't work, include the code for the method so the volunteers here can look and help
2 - Use the globalization features available to you. There are functions for things like "decimal divider" that will return either a period, or a common or a custom user set string depending on your localization.
Aug 6 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by moondaddy | last post: by
9 posts views Thread by Python.LeoJay@gmail.com | last post: by
4 posts views Thread by vighnesh | last post: by
3 posts views Thread by SharpCoderMP | last post: by
2 posts views Thread by Nicolai.Schoenberg@googlemail.com | last post: by
4 posts views Thread by =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post: by
2 posts views Thread by Mika M | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.