Hello,
I am incredibly puzzled.
I have made a small, fairly simple calculator for specific purposes. I can run this fine on my computer. But when I try to run it on a target computer (from Norway) I get an error that puzzles me.
Here's the strange behavoir:
This piece of code works fine on both computers, and with out a dought should.
This is where it get's wierd:
This doesn't work on a computer in Norway, but on all the computers I have tried that I can access it works fine.
So the problem is converting a String to a Double.
More specifcaly this piece of code:
When
Even though there should be no problem.
I have coded the calculator to where you can only enter valid characters to the textBox. (numbers and one decimal are allowed)
When I get the error from the computer in Norway, it's telling me that I can't convert "1.1" in the textBox to a Double. Which should work, but for some odd reason doesn't. I've tried a lot of differant things like taking the "1.1" from the textBox and putting it in a string, then trying to parse that, same error. So what I'm wonering is if there might be some type of language conversion problem, or something buggy with that computer?
Both computers have Win7, and the latest .NET framework. Which reminds me that I have used the 4.0 Beta framework to program this, so what I also tried was re-writing for 3.5. Which also gave me the same error.
I am incredibly puzzled.
I have made a small, fairly simple calculator for specific purposes. I can run this fine on my computer. But when I try to run it on a target computer (from Norway) I get an error that puzzles me.
Here's the strange behavoir:
Code:
textBox.Text = "1"; double result = double.Parse(textBox.Text) * .15;
This is where it get's wierd:
Code:
textBox.Text = "1.1"; double result = double.Parse(textBox.Text) * .15;
So the problem is converting a String to a Double.
More specifcaly this piece of code:
Code:
double.Parse(textBox.Text)
Code:
textBox.Text = "1.1";
I have coded the calculator to where you can only enter valid characters to the textBox. (numbers and one decimal are allowed)
When I get the error from the computer in Norway, it's telling me that I can't convert "1.1" in the textBox to a Double. Which should work, but for some odd reason doesn't. I've tried a lot of differant things like taking the "1.1" from the textBox and putting it in a string, then trying to parse that, same error. So what I'm wonering is if there might be some type of language conversion problem, or something buggy with that computer?
Both computers have Win7, and the latest .NET framework. Which reminds me that I have used the 4.0 Beta framework to program this, so what I also tried was re-writing for 3.5. Which also gave me the same error.
Comment