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


Groups > comp.lang.python > #89666

Rounding a number

From Seymore4Head <Seymore4Head@Hotmail.invalid>
Newsgroups comp.lang.python
Subject Rounding a number
Date 2015-04-30 15:49 -0400
Message-ID <du05kahu2bla717q2b09fc2p0foou7odcd@4ax.com> (permalink)
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


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))

Back to comp.lang.python | Previous | NextNext 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