Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'python': 0.09; 'accepts': 0.09; 'calculates': 0.09; 'directive.': 0.09; 'inserted': 0.09; 'subject:number': 0.09; 'url:peps': 0.09; 'cc:addr:python-list': 0.10; '","': 0.16; '1,000': 0.16; 'also:': 0.16; 'specifier': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'url:dev': 0.17; 'input': 0.18; 'cheers,': 0.23; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'url:python': 0.32; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'url:org': 0.36; '(i.e.': 0.36; 'url:library': 0.36; 'subject:: ': 0.38; 'url:docs': 0.38; 'instead': 0.39; '2013': 0.84; 'sender:addr:chris': 0.84; 'url:string': 0.84; 'eli': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3nMte5D2SXhbduVCy6t6XW1vBvtGA4vXdLw8MAlk/QA=; b=fvIwx+HERDuc44ekJh7df6ltoT4X01K02VRtEHH937N7WR+MmWWavixnMS52zgquJr S9MF5SvqSXq7m+4FsF//KnK8xHi2q8PqesvRkpyxXHKrJu8Kn56u3BAwmBAYa3cw/CBJ JVZBwoyTkjg8QOFbjr8RSLXhILoyE+0/fmzFg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=3nMte5D2SXhbduVCy6t6XW1vBvtGA4vXdLw8MAlk/QA=; b=ke6KuMlrZMKZmgFpnyXxFp/f9AXoiAddfMrfCvOKl8hzXeFVxm4cRHOloQyP5JT3+0 muW36p+8qa0JV4x2P+7cEZMmzP1JS2uZ8Acj7oTd0GA7mNGEsztR2h1YVz5HOD+sOnZ6 ktAR032irtOlYlJp4vZlEGECIAXBlWdPDbS/QdjFbm6o4KP/t8FDQukPFSG09wMdpvz3 Jfb7+BzHYXNWvpuwRhqmE7SZc2BXO7y/GrYDQou7f+K1CMoN6Oy3JbstksTCBZLX/YVt W+tjPycQ1yiTSZrFZzXzQ1P/N+Z8qs0UajqGGIUfQx3T+bKx/mbwxrHkD/XOdfOVEPHs ZlTw== MIME-Version: 1.0 X-Received: by 10.50.212.38 with SMTP id nh6mr12476681igc.72.1362614831327; Wed, 06 Mar 2013 16:07:11 -0800 (PST) Sender: chris@rebertia.com In-Reply-To: <9c8df3b5-510a-4d00-a3ff-0c59799dcded@googlegroups.com> References: <9c8df3b5-510a-4d00-a3ff-0c59799dcded@googlegroups.com> Date: Wed, 6 Mar 2013 16:07:11 -0800 X-Google-Sender-Auth: SKLz7MBeRaKIYKu9WhQaTGmZiKM Subject: Re: Insert comma in number? From: Chris Rebert To: eli m Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmgYQDKfHOjH7SsbKMGvbTpwFJ+miVhCmInmr+/4ZZhq1Ou94bbHc/2EWUa4qA9o/OVea+a Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362614840 news.xs4all.nl 6871 [2001:888:2000:d::a6]:53930 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40675 On Wed, Mar 6, 2013 at 3:39 PM, eli m wrote: > I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. > For example: instead of 1000 it would say 1,000 Use the "," (i.e. comma) format() specifier directive. See http://docs.python.org/2/library/string.html#format-specification-mini-language See also: http://www.python.org/dev/peps/pep-0378/ Cheers, Chris