Re: C# format Specifiers Help.

Discussion in 'C Programming' started by Jeff, Aug 21, 2003.

  1. Jeff

    Jeff Guest

    "Kevin" <> wrote in message
    news:...
    > I am looking for a way in C# to format my output. I want to be able
    > to specify a disply width and then have the variable printed at
    > minimum with that width.
    >
    > I can accomplish this is C and C++ as follows:
    >
    > C - printf("%5d", someInt);
    >
    > C++ cout << setw(5) << someInt;
    >
    > What is the C# equivalent? I have been trying:
    >
    > Console.Write("{0:D5}", someInt); - This however has leading zeros
    > placed in it.
    >
    > Thanks for your Help.


    C# is off-topic here. We only talk about ANSI C.

    >
    > Kevin


    --
    Jeff
     
    Jeff, Aug 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pep
    Replies:
    0
    Views:
    637
  2. Ben Pfaff

    Re: C# format Specifiers Help.

    Ben Pfaff, Aug 21, 2003, in forum: C Programming
    Replies:
    0
    Views:
    407
    Ben Pfaff
    Aug 21, 2003
  3. Martin Ambuhl

    Re: C# format Specifiers Help.

    Martin Ambuhl, Aug 21, 2003, in forum: C Programming
    Replies:
    4
    Views:
    500
    Randy Howard
    Aug 22, 2003
  4. Peter Ammon

    Writing arguments under format specifiers

    Peter Ammon, Jul 4, 2004, in forum: C Programming
    Replies:
    4
    Views:
    309
    Mike Wahler
    Jul 6, 2004
  5. John Mott
    Replies:
    2
    Views:
    312
    John Mott
    Aug 7, 2007
Loading...

Share This Page