General Discussion Off-Topic Discussion and Enlightenment

i need help with VB.NET

Thread Tools
 
Search this Thread
 
Old Oct 6, 2004 | 06:57 PM
  #1  
J-MAN's Avatar
Thread Starter
0.0 BAR
 
Joined: Mar 2003
Posts: 0
Default i need help with VB.NET

ok, i hope somebody can help me out because i am so stuck and have looked in the book and can't find ----.
here's the problems, i need to know the coding to have the numbers displayed to only go 2 numbers past the decimal point. and how would i make a button to clear the form to start over. kinda like a reset button.
any help would be appriciated.
Old Oct 6, 2004 | 10:38 PM
  #2  
J-MAN's Avatar
Thread Starter
0.0 BAR
 
Joined: Mar 2003
Posts: 0
Default Re: i need help with VB.NET

ok i figured out how to reset the form but still don't know how to get the number to stop after two past decimal.
Old Oct 7, 2004 | 10:04 AM
  #3  
Johnyquest's Avatar
1.0 BAR
 
Joined: Jan 2003
Posts: 438
Default Re: i need help with VB.NET

in vb it's like precision(2) or setprecision(2)... I am 99% on that one.

Matt
Old Oct 7, 2004 | 12:32 PM
  #4  
stingray's Avatar
1.5 BAR
 
Joined: Jun 2003
Posts: 681
Default Re: i need help with VB.NET

couldn't you do something like .... and use a substring.... (indexof("."),2)
Old Oct 8, 2004 | 09:06 PM
  #5  
Project CRXtacy's Avatar
1.5 BAR
 
Joined: Apr 2004
Posts: 728
Default Re: i need help with VB.NET

Originally Posted by jeffsciv23
ok i figured out how to reset the form but still don't know how to get the number to stop after two past decimal.
damn thats hard i been trying and i cant get it man )=- sry if i do then i can tell you.
Old Oct 8, 2004 | 09:54 PM
  #6  
TekPhobia's Avatar
1.0 BAR
 
Joined: Jan 2004
Posts: 253
Default Re: i need help with VB.NET

Store the numeric value in a string. Let, d, be your decimal and s be your string:

d=1.216589765

s=d.ToString("0.00")

Voila!

-Tim
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
98ctr
General Discussion
28
Jan 5, 2005 01:47 AM
93hatchdx
General Discussion
5
Dec 22, 2004 11:19 AM
digihippie
Hybrid/Tech
0
Sep 19, 2004 05:58 AM
Xplocivic
General Discussion
2
Dec 13, 2003 09:48 PM
91rexBUG
General Discussion
26
Jul 29, 2003 02:23 PM




All times are GMT -5. The time now is 06:43 AM.