0

I have a program which iterates and creates folders whose names contains variables (e.g, "Folder 3, iteration 27"). Those folders are created with the os package.

os.makedirs(pathFolder+ '/Factor %f' %factor + ' and Tmin %i' %Tmin)

The factor variable is a float type with value 0.7, and the folder, when it's been created has the following name:

Factor 0.70000 and Tmin 2

I want to get only 0.7 in the folder's name, not the following zeros.

I have tried the round function, but the same problem appears.

Any ideas?

2
  • @zondo that solved my problem! Thanks! Commented May 6, 2016 at 21:21
  • @alfasin that also solved my problem! Thanks! Commented May 6, 2016 at 21:23

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.