This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aubmoon
Recipients BreamoreBoy, aubmoon, eric.smith, mark.dickinson, ned.deily, skrah
Date 2014-03-01.23:04:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAM8Gk7q3NrNJyp45GveGvD+8M=+U2DERvX652PJ-hVZbVrn-Fg@mail.gmail.com>
In-reply-to <1393711046.18.0.494918445241.issue20811@psf.upfronthosting.co.za>
Content
That is exactly what I tried first. It turns out in the particular case I
have been working the 8th digit is needed for correct answers. The job is a
port of a punch card FORTRAN system into something more modern. The catch
is the system is a scientific application that protects life, limb, and
treasure. The new system must inter-operate with the legacy system until
the entire system can be replaced with VV&A software under configuration
control. In my particular case the sign must be printed, the decimal must
be printed, and all eight digits. The number is always strictly -1 < x < 1
and has eight significant digits. The number is the included in a larger
string of data. What I have done to address the issue is format the x
string separately from the rest of the data and then slice and join
out the undesired
leading 0. Then include the value as a %s format in the larger context.

On Saturday, March 1, 2014, Stefan Krah <report@bugs.python.org> wrote:

>
> Stefan Krah added the comment:
>
> aubmoon: Would it be a possibility just to use 'f' instead?
>
> >>> "{:+10.7f}".format(1.12345678)
> '+1.1234568'
> >>> "{:+10.7f}".format(0.12345678)
> '+0.1234568'
>
> ----------
> nosy: +skrah
>
> _______________________________________
> Python tracker <report@bugs.python.org <javascript:;>>
> <http://bugs.python.org/issue20811>
> _______________________________________
>
History
Date User Action Args
2014-03-01 23:04:35aubmoonsetrecipients: + aubmoon, mark.dickinson, eric.smith, ned.deily, skrah, BreamoreBoy
2014-03-01 23:04:35aubmoonlinkissue20811 messages
2014-03-01 23:04:34aubmooncreate