comma

This is a discussion on comma within the C# Programming forums, part of the General Programming Boards category; Given a variable between 0 and 2,000,000 how to print out with proper commas Eg;if we input 12345 the output ...

  1. #1
    hug
    hug is offline
    Registered User
    Join Date
    Dec 2002
    Posts
    1

    comma

    Given a variable between 0 and 2,000,000 how to print out with proper commas
    Eg;if we input 12345 the output should be 12,345

  2. #2
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    The input should be a string. Then counting the number of spaces form the end instead of the beginning, add the commas in the places.
    Or something like that.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array (seperate inputs by comma)
    By chuckwag0n in forum C++ Programming
    Replies: 7
    Last Post: 04-03-2009, 02:10 PM
  2. Array (seperate inputs by comma)
    By chuckwag0n in forum C Programming
    Replies: 1
    Last Post: 04-02-2009, 02:01 PM
  3. comma and semi colon
    By studentc in forum C Programming
    Replies: 13
    Last Post: 05-14-2004, 06:49 PM
  4. Comma Operator
    By doraiashok in forum C Programming
    Replies: 2
    Last Post: 12-09-2003, 08:38 AM
  5. Delete last Character (comma) ?
    By Hexxx in forum C Programming
    Replies: 2
    Last Post: 10-19-2003, 01:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21