468,301 Members | 1,529 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Hi need help in debugging

1
Hi i am new to VB and am writing a small prog to calculate
some values in a formulae..

for the input i have used a text box so that user inputs
the number
and based on that number is stored as a constant to be used in the formule.
and on clicking a button the out put is shown in another
text box.. i am facing a peculiar problem.. when ever the user types in a number he does not receive the correct
out put unless he enters the input as a decimal

for instance if he enters input as 20 the out put val is wrong and if he enters 20.0 the outputvalue is correct...
i have declared all variables as double where the input and other formulea constants are stored,
pls help..to rectify this

Thanks
nar
Nov 20 '06 #1
2 921
sivadhas2006
142 100+
Hi,

Can you post your code to find the problem?

Regards,
M.Sivadhas.
Nov 20 '06 #2
willakawill
1,646 1GB
Hi i am new to VB and am writing a small prog to calculate
some values in a formulae..

for the input i have used a text box so that user inputs
the number
and based on that number is stored as a constant to be used in the formule.
and on clicking a button the out put is shown in another
text box.. i am facing a peculiar problem.. when ever the user types in a number he does not receive the correct
out put unless he enters the input as a decimal

for instance if he enters input as 20 the out put val is wrong and if he enters 20.0 the outputvalue is correct...
i have declared all variables as double where the input and other formulea constants are stored,
pls help..to rectify this

Thanks
nar
Hi. Shooting in the dark without your code here :)
When you take the value from the textbox and assign it to a variable make sure to cast it as a double;
Expand|Select|Wrap|Line Numbers
  1. MyDoubleVariable = CDbl(TextBox1.Text)
  2.  
In the absence of you code, this is the best I can do
Nov 20 '06 #3

Post your reply

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

Similar topics

2 posts views Thread by lawrence | last post: by
5 posts views Thread by Jerry Polyak | last post: by
reply views Thread by Eric Clapton | last post: by
1 post views Thread by Dhanak | last post: by
2 posts views Thread by Andy Fish | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.