[Re: [Tutor] Format strings for variables - how?]

Viktor Lakics lakicsv@usa.net
8 Feb 2001 10:06:55 GMT


Thanks Lindsay and David,

> ...or alternatively make the variable type explicit...
> =

> a =3D float(1)
> b =3D float(3)
> print "%0.2f" %(a/b)

That is what I was after! I knew that if I do 1.0/3 I get a floating poin=
t no
as a result. My problem was, that how to define my variable in a way that=
 if
such division happens (eg. number from user input), then I want to see th=
e fp
number...

Thanks Viktor


----Viktor Lakics----

Through the Internet:

  lakicsv@usa.net


____________________________________________________________________
Get free email and a permanent address at http://www.amexmail.com/?A=3D1