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


Groups > comp.lang.python > #89668

Re: Rounding a number

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Rounding a number
Date 2015-04-30 21:08 +0100
References <du05kahu2bla717q2b09fc2p0foou7odcd@4ax.com> <1430424017.1387850.261172393.5226A2E8@webmail.messagingengine.com>
Newsgroups comp.lang.python
Message-ID <mailman.145.1430424529.3680.python-list@python.org> (permalink)

Show all headers | View raw


On 30/04/2015 21:00, Thijs Engels wrote:
> 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
 > round(65253, -3)
 >
 > might be what you are looking for...
 >
 >

True, but please don't top post here.  It's no problem on short threads, 
but as they get longer trying to follow when top posting is involved is 
nigh on impossible.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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