How to get two digits for disc and track?

Hi there,
I have been playing around with the renaming of my collections, I really like it,
however I am stuck trying to have the tags for discnumber and tracknumber to
be in two digits, ie, disc 01, 02; and track 01, 02.

This is my script

%albumartistsort%/%date% %albumsort%/%albumartistsort% %discnumber%%tracknumber% %titlesort%

So I want it to come out like

Bowie, David 0101 space oddity.mp3 instead of
Bowie, David 11 Space Oddity.mp3


1 Like

You can use the $num function to add leading zeroes. Try



All right, that worked just fine, functions are not my thing, I was doing it all wrong,
this did the trick,


1 Like

I am new to MusicBrainz. I too want to make the track # 2 digits, just where do I find and edit this:


Assuming that you want this in the file names for your audio files, you would include it in the File Naming Script set in the File Options section of the Option Settings. You can use the File Naming Script Editor to make the changes to your selected file naming script. You may also want to have a look at the Writing a File Naming Script tutorial for more information.

1 Like

I am using this,

%originalyear% %album%/
%albumartistsort% $num(%discnumber%,2)$num(%tracknumber%,2) %title%

You get file names like this

/Musique/Bowie, David/1971 Hunky Dory/Bowie, David 0105 Kooks.mp3

try this,

%albumartistsort% $num(%tracknumber%,2) %title%

play arround with the sintax, you’ll get there