% format strings
ziller at gmail.com
Tue Aug 24 05:19:39 CEST 2004
Erik Max Francis <max at alcyone.com> wrote in message news:<412A76A7.4C87D17C at alcyone.com>...
> grv575 wrote:
> > Is
> > there a way to specify the precision length for floating points in C
> > format strings?
> Yes, it looks the same as in Python. Python got the notation from C.
I meant to say how does it translate the *. Python lets you use a
variable to specify the length of precision.
int f_length = 5;
float fl = 3.5
printf("%.*f", f_length, fl);
More information about the Python-list