Message215887
The rule is:
- if the entire format specifier is the empty string (not None, but ''), then return str(value)
- else, look at the presentation type. if it is missing, set it to something like 'g'
- do the normal float formatting using the presentation type
The first of these has an empty string for the format specifier (so uses str(1e10), the rest do not:
>>> format(1e10, '')
'10000000000.0'
>>> format(1e10, ' ')
' 10000000000.0'
>>> format(1e10, ' g')
' 1e+10'
>>> format(1e10, ' e')
' 1.000000e+10'
>>> format(1e10, ' f')
' 10000000000.000000'
Now, how much the "something like g" part of the above is true is debatable. |
|
Date |
User |
Action |
Args |
2014-04-10 15:04:53 | eric.smith | set | recipients:
+ eric.smith, mark.dickinson, lebigot, docs@python |
2014-04-10 15:04:53 | eric.smith | set | messageid: <1397142293.74.0.208420838357.issue21195@psf.upfronthosting.co.za> |
2014-04-10 15:04:53 | eric.smith | link | issue21195 messages |
2014-04-10 15:04:53 | eric.smith | create | |
|