V
V
Vadim Gush2014-04-10 17:44:41
Java
Vadim Gush, 2014-04-10 17:44:41

How to make numbers of format 001 002 009 011 013 etc.?

There is such a problem in java, my program uses a loop to load the animation of the model, but each frame of the model looks like this anim_mod_000001 next frame anim_mod_000002 and so on.
In the loop, I made it so that there is a number n, and it is added by one after loading each frame, that is, in the code I wrote like this loadingModel("anim_mod_00000"+ n);
But the problem arises when n becomes a two-digit number. How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
svd71, 2014-04-10
@svd71

loadingModel("".format("anim_mod_%5d", n));

loadingModel("".format("anim_mod_%05d", n));

loadingModel("".format("anim_mod_%50d", n));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question