Re: Formatting floating point

2019-10-07 Thread DL Neil via Python-list
On 8/10/19 4:04 AM, boffi wrote: DL Neil writes: Agreed: there's ton(ne)s of information 'out there', much of it old, eg Python2, "formatter" (deprecated since v3.4) ? are you referring to the `string.Formatter`[*] class? $ python Python 3.7.4 (default, Aug 13 2019, 20:35:49) [

Re: Formatting floating point

2019-10-07 Thread boffi
DL Neil writes: > Agreed: there's ton(ne)s of information 'out there', much of it old, > eg Python2, "formatter" (deprecated since v3.4) ? are you referring to the `string.Formatter`[*] class? $ python Python 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] :: Anaconda, Inc. on

Re: Formatting floating point

2019-09-04 Thread DL Neil via Python-list
On 5/09/19 5:12 AM, Dave via Python-list wrote: ... My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Agreed: there's ton(ne)s of information 'out there', much of it old, eg Python

Re: Formatting floating point

2019-09-04 Thread Dave via Python-list
On 9/4/19 1:38 PM, Rhodri James wrote: On 04/09/2019 18:12, Dave via Python-list wrote: My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Here: https://docs.python.org/3/library/str

Re: Formatting floating point

2019-09-04 Thread Dave via Python-list
On 9/4/19 1:25 PM, Chris Angelico wrote: On Thu, Sep 5, 2019 at 3:16 AM Dave via Python-list wrote: All, I have been going in circles trying to format a floating point number so there is only 1 decimal place. In reading all of the gobble-gook that passes for Python advice, it looked like I s

Re: Formatting floating point

2019-09-04 Thread Rhodri James
On 04/09/2019 18:12, Dave via Python-list wrote: My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Here: https://docs.python.org/3/library/string.html#format-specification-mini-langu

Re: Formatting floating point

2019-09-04 Thread Chris Angelico
On Thu, Sep 5, 2019 at 3:16 AM Dave via Python-list wrote: > > All, > > I have been going in circles trying to format a floating point number so > there is only 1 decimal place. In reading all of the gobble-gook that > passes for Python advice, it looked like I should have done this: > > numStr =

Formatting floating point

2019-09-04 Thread Dave via Python-list
All, I have been going in circles trying to format a floating point number so there is only 1 decimal place. In reading all of the gobble-gook that passes for Python advice, it looked like I should have done this: numStr = '3.14159' num = float(numstr) # OK so far numFmt = format(num, '{