Can someoone plese post the code to take 2 or 3 text boxes. enter numbers into each then add, subtract, multiply, etc and output the results into another text box or paragraph.
Thanks.
Professional Software Development Tools
Can someoone plese post the code to take 2 or 3 text boxes. enter numbers into each then add, subtract, multiply, etc and output the results into another text box or paragraph.
Thanks.
Hello,
Here's the simplest way i could think of to do this. obviously you'll want to add checks (in case, for example, one input is left blank . . . )
But this example covers the math of what you are trying to do (or at least, what I think you're trying to do!!)
Enjoy,
Desmond.
That was what I needed. Thanks.
Now if I want to round up everything that is a fraction how would I use that just for the total box?
I looked at the math.ceil function but I was not sure how to implement it using a textbox for result.
your_number = 3.1415;
your_rounded_number = Math.Ceil(your_number);
Say my number is 46.1 and I am going to call it value 6 and display it into Input4
Input.SetText("Input4", value6)
I am not sure if I understood your question correctly. If you have 46.1 and want to end up with 47, then the following code should do it:
value5 = 46.1
value6 = Math.Ceil(value5);
Input.SetText("Input4", value6);
cchian just FYI, you should be able to use:
value5 = Math.Ceil(value5);
Or for that matter:
Input.SetText("Input4", Math.Ceil(value5));
Corey Milner
Creative Director, Indigo Rose Software
That took care of it.
One last (I hope) problem on this.
If I put a letter instead of a number into the texboxes it gives me an error.
How do I make sure someone only enters numbers instead of letter, etc.?
Patrick
Do a search for "Masked Input" and you will be able to do exactly what you are asking![]()