On 8/14/07, Ron Adam <[EMAIL PROTECTED]> wrote: > Jim Jewett wrote: > > On 8/13/07, Ron Adam <[EMAIL PROTECTED]> wrote:
> >> {name[:][type][alignment_term][,content_modifying_term]} > > ... You used the (alignment term) > > width as the number of digits before the decimal, > > instead of as the field width. > You can leave out either term. So that may have > been what you are seeing. I thought I was going based on your spec, rather than the examples. > {0:f8.2} Because there is no comma, this should be a field of width 8 -- two after a decimal point, the decimal point itself, and at most 5 digits (or 4 and sign) before the the decimal point I (mis?)read your messge as special-casing float to 8 digits before the decimal point, for a total field width of 11. ... > Minimal width with fill for shorter than width items. It > expands if the length of the item is longer than width. ... > > Can I say "width=whatever it takes, up to 72 chars ... > > but don't pad it if you don't need to"? > That's the default behavior. If width is only a minimum, where did it get the maximum of 72 chars part? > > I'm not sure that variable lengths and alignment even > > *should* be supported in the same expression, but if > > forcing everything to fixed-width would be enough of > > a change that it needs an explicit callout. > Alignment is needed for when the length of the value is shorter than the > length of the field. So if a field has a minimal width, and a value is > shorter than that, it will be used. I should have been more explicit -- variable length *field*. How can one report say "use up to ten characters if you need them, but only use three if that is all you need" and another report say "use exactly ten characters; right align and fill with spaces." -jJ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com