Hi Simon, I stand corrected. Your second suggestion did work. Sorry, I was relying on someone testing my program that did not do their calculations correctly. Thank you for your help, 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>