Discussion in 'Questions (Windows Mobile)' started by cdeane, Apr 24, 2008.
How do I get a average of .125 or less In a TextBox?
And can I center the text in a TextBox?
What do you mean with getting an average?
You can change the text alignment with FormLib.TextAlignment.
Thanks for the text alignment help Erel.
By average I mean that I get something like 50.1246887 in my TextBox but I need
If I resize the TextBox to fit then I may need a diffrent value at some point like 23.5 in which case the TextBox would then read 23.495 which I do not need.
What you need, I think, is
for 3 digits.
val = 56.123432
textbox.text = round(val,3)
I hope I'm right and this helps
Or you can use the format function:
Will display: 1,234.57
I do not know what value the TextBox will throug out at any given time.
I need someting like : Round(TextBox.Text,2)
Which of course dose not seem to work.
It depends on what you want to do.
- do you want do display a variable like x=54.124678 but roundet with 3 digits after the decimal point ?
This is the case of both suggested solutions.
- do you want to allocate the value in the TextBox to a variable but rounded ?
- do you want the variable in the Textbox rounded during input ?
This would be somewhat more complicated, but you can use the Door library
and look at agrahams example of Uppercase in textbox or the livefilter example and adpt it to your requirement.
You will find this in:
Your exatcly right Klaus.
I want it done at input. ei, TextBox1.Text=TextBox2.Text+TextBox3 ,then have it rounded out.
Ill see what the link will produce.
Is it this what you are looking for ?
That looks like what Im looking for.
Much apreciation to every ones advice.