Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #89667

Re: Rounding a number

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <thijs@buckazoids.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.039
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'received:internal': 0.09; 'subject:number': 0.09; 'message-id:@webmail.messagingengine.com': 0.16; 'nearest': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'wrote:': 0.18; 'skip:f 30': 0.19; 'thu,': 0.19; 'print': 0.22; 'header:In-Reply-To:1': 0.27; 'url:mailman': 0.30; 'getting': 0.31; 'url:python': 0.33; 'received:66': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'should': 0.36; 'two': 0.37; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'url:2012': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'read': 0.60; 'numbers': 0.61; 'range': 0.61; 'header:Message-Id:1': 0.63; '30,': 0.65; 'hundred': 0.95
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=buckazoids.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=WZa/JSk0js1PdxCUBTeB8Utggso=; b=K1YANg qp8eACxV93pcNcEr27C1c6+ZU7Ntw3pELTjmXDqvQOD9DksOyMhZbmIfjfhPbJuy HaIKxtxQHgibiueHDFQdbVfJDEymuL2yWgH8Vev+KO2mDVHYqq+roZ1Cg0YDrc4a +8AF3mhQ/tod8/8UOjgdBVf3AAtRPiXD27PDw=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=WZa/JSk0js1PdxC UBTeB8Utggso=; b=TCofqG+5oN9aNOKkbsQA38CDj1Oa+WVcHVtQhwC8G+cJr4O 2dFBaYfVTRKAhU9STH2EwnkqSVfEQ4y3dgEvRGPPcG/Dx1kl4KweGzHTiBfLOizY hUwQKh8imlO55ADOcScQN4+Zs/2axVpcL/mDQ3WZ8bZiPDPKcVw6oHKbmGgU=
X-Sasl-Enc m8I8ENLZlVzQu5WONVSFfYClbqX4uwzgndIiqFpwH0Va 1430424017
From Thijs Engels <thijs@buckazoids.com>
To python-list@python.org
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type text/plain
X-Mailer MessagingEngine.com Webmail Interface - ajax-f5f4dd6c
Subject Re: Rounding a number
Date Thu, 30 Apr 2015 22:00:17 +0200
In-Reply-To <du05kahu2bla717q2b09fc2p0foou7odcd@4ax.com>
References <du05kahu2bla717q2b09fc2p0foou7odcd@4ax.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.144.1430424020.3680.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1430424020 news.xs4all.nl 2905 [2001:888:2000:d::a6]:57806
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:89667

Show key headers only | View raw


round(65253, -3)

might be what you are looking for...


On Thu, Apr 30, 2015, at 21:49, Seymore4Head wrote:
> I have this page book marked.
> https://mkaz.com/2012/10/10/python-string-format/
> 
> I am getting numbers from sixty thousand to two hundred thousand.
> I would like to round them to the nearest thousand.
> So 65,253 should read 65,000.
> How?
> 
> Total=2100
> for x in range (10,35):
>     count=1000/x
>     print ("Foo {:7,.0f} Fighters".format(Total*count))
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Rounding a number Seymore4Head <Seymore4Head@Hotmail.invalid> - 2015-04-30 15:49 -0400
  Re: Rounding a number Thijs Engels <thijs@buckazoids.com> - 2015-04-30 22:00 +0200
    Re: Rounding a number Seymore4Head <Seymore4Head@Hotmail.invalid> - 2015-04-30 18:35 -0400
      Re: Rounding a number Dave Angel <davea@davea.name> - 2015-04-30 18:58 -0400
  Re: Rounding a number Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-30 21:08 +0100
  Re: Rounding a number Tony the Tiger <tony@tiger.invalid> - 2015-05-02 21:34 +0000

csiph-web