CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2010
    Posts
    13

    [RESOLVED] 17000 -> 17.000 and sharp margin?

    Hello,

    I have three values, for instance 17000, 12345 and 4655. Is there any special way to present them like below? Please note the dots(.) and the sharp left margin. (NET3.5 / VS 2008 )

    Code:
    number1         17.000 
    number2:        12.345
    result:		4.655

  2. #2
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: 17000 -> 17.000 and sharp margin?

    Quote Originally Posted by LoopString View Post
    Code:
    number1         17.000 
    number2:        12.345
    result:        4.655
    Simple format your string. How is the output doen? Console application?
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  3. #3
    Join Date
    Feb 2010
    Posts
    13

    Re: 17000 -> 17.000 and sharp margin?

    Thanks for the answer, yes it is console application, playing around in visual studio.

  4. #4
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: 17000 -> 17.000 and sharp margin?

    Quote Originally Posted by LoopString View Post
    Thanks for the answer, yes it is console application, playing around in visual studio.
    Code:
    int a = 17000;
    int b = 12345;
    int c = a - b;
    Console.WriteLine("number1       {0:0,0}",a);
    Console.WriteLine("number2       {0:0,0}", b);
    Console.WriteLine("result        {0:0,0}", c);
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  5. #5
    Join Date
    Feb 2010
    Posts
    13

    Re: 17000 -> 17.000 and sharp margin?

    Thank you JonnyPoet, your code is like poetry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured