Hi Simon, Thanks for your response. I had already tried putting in the quotes and it did not work. It compiles but at run time it gives me an error. Your second suggestion works, but instead of giving me 3.77 it returns 37.7. I tried a couple of things like {0:00.##} and it still return 37.7 I tried {0:.##} and it still did not return what I need. Any other ideas. Thank You, Celia From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Simon Gaudiuso Sent: Wednesday, March 31, 2010 5:54 PM To: programmingblind@xxxxxxxxxxxxx Subject: RE: C # question You forgot to put in the quotes, String.Format expects the first parameter to be a string hence the format. TextBox = String.Format("{0:D2}", Volume); If that doesn't work you can try: String.Format("{0:0.##}", Volume); -Simon > From: celia-rodriguez@xxxxxxxxxxxxx > To: programmingblind@xxxxxxxxxxxxx > Subject: RE: C # question > Date: Wed, 31 Mar 2010 17:29:22 -0500 > > Hi Varun, > > Can you tell me how to display 3.3333 in a text box as 3.33 > My teacher gave us the below code but the compilar does not like it. > I know you use the String.Format The below is what I was strying to code, > but I keep getting errors. > TextBox = String.Format({0:D2}, Volume); > The compilar does not like the { nor the :. > Can you help? > > Thank you, > Celia > > __________ > View the list's information and change your settings at > //www.freelists.org/list/programmingblind > _____ The New Busy is not the old busy. Search, chat and e-mail from your inbox. Get started. <http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON: WL:en-US:WM_HMP:032010_3>