RE: C # question

  • From: Simon Gaudiuso <spg1111@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 31 Mar 2010 18:54:25 -0400

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.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3

Other related posts: