
for example we have the value 30.6475 which we would like to print to the screen as a dollar value like $30.65. What we could do is a rounding of the value 30.6475 and print it in combination with the dollar sign. It can also be done as shown below with a command like print "$%.02f" %30.6475
the 2f is used to define the amount of numbers behind the point. so we can make it for example 3 if we want a output like $30.648.

1 comment:
this is my first visit to ur Blog , but u have impressed me since paython is not of expertise list ,..
Post a Comment