:hammer: anybody using vb.net ? if so can u tell me how to limit the numbers after the decimal point displayed in the answer text box other than reducing the size of the box .
:hammer: anybody using vb.net ? if so can u tell me how to limit the numbers after the decimal point displayed in the answer text box other than reducing the size of the box .
http://www.optispares.btinternet.co.uk
jack
It is by universal misunderstanding that all agree. For if, by ill luck, people understood each other, they would never agree.
try this...
Dim oldValue as String
Dim newValue as string
oldValue = "3.141592654"
newValue = FormatNumber(oldValue, 2, , , TriState.False)
newValue now equals "3.14"
not sure if i follow this my old value is not a constant as it is the answer to an equation so it is variable. i just want it to dispay as say eg. 3.25 rather than 3.2496751234Originally Posted by QDO1
http://www.optispares.btinternet.co.uk
jack
It is by universal misunderstanding that all agree. For if, by ill luck, people understood each other, they would never agree.
ORIGINALOriginally Posted by QDO1
TextBox6.Text = Answer
JUST NEEDED TO ADD
TextBox6.Text = Answer .ToString("F")
http://www.optispares.btinternet.co.uk
jack
It is by universal misunderstanding that all agree. For if, by ill luck, people understood each other, they would never agree.
sweetOriginally Posted by optispares
You should check out the Format$ method, too (assuming they still offer it in .Net). It will format numbers in a variety of ways and then convert them directly to a string. It's probably the simplest and most flexible solution. Of course, you can also round numbers to a given decimal place using the Round method.
Darryl J. Meister, ABOM
out of interest - what developer software is every one using?
I, personally, just use Microsoft's Visual Basic 6.0 and just a basic text editor for web programming.
Darryl J. Meister, ABOM
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks