Add "always assume padded zeroes" for m4a files option

Hi there,

today, for the first time in the many years of me using mp3tag, I've worked with an album consisting of m4a files and noticed that no matter what I did, a padded zero would not be accepted.

After some googling I found a thread on this forum stating that the m4a standard does not support padded zeroes.

However, couldn't you just always pad them in the tag field on reading the tags, so tag->filename conversions work properly without annoying trickery?

I always work with padded zeroes, so there's not really any instance at all where I would work with non-padded tracknumbers. Some might, and because of that I'd suggest an opt-in option checkbox that specifies this behavior.

Hope this is not too much to ask for, until then I'll just pad them with Bulk Rename Utility (or by hand if it's just the first 9 files in the album).

Thanks for listening, and thanks for this awesome program,


To get padded zeros in the filename, use
$num(%track%,2) or $num(%track%,3)
instead of a simple %track% for the format string in the convert function.

If you want to see padded zeros in the columns, enter
$num(%track%,2) or $num(%track%,3) in the field "value" of the column definition.

Please note that 3-digit-values with leading zeros are interpreted by windows as octal numbers.

1 Like

Thanks for the suggestions!

It's a workaround, but I'd be happier with a simple checkbox in the menu so I just need to type %track%.

It also doesn't display the padded zero in the tag panel on the left.

iTunes simply interpretes 1's as 01's in m4a's as well, so I don't see why mp3tag shouldn't.

Because it is non-standard?
AFAIK you can't store padded zeros in the track field of mp4 files.
Perhaps iTunes needs it to sort properly? I don't know.
You would not have that problem if you tick "numeric" for the column definition.

I did check "numeric" ... still only shows "1".

That's why I'm talking about an opt-in option. Those who want it can have it, those who don't never need to bother with it. I don't really see the harm in it, even it it's not "standard".

The "numeric" takes care of the correct sorting. It says nothing about padding.
The "opt in" solution is that you can define your own column definition.
BTW: if you add leading zeros to the track field in an MP4 tag then these will not be saved. It is up to the program to show them.

Yes, I realised that back when I made this post - I tried to make it stick but no matter what I did it wouldn't save. Found out via Google that m4a doesn't specifically store the padded zero.

Well anyway, thanks for your help. As long as sorting and renaming from tags works fine with padded 0's it's all good. The checkbox would be nice, especially since iTunes pads zeroes as well on m4a filenames without making a fuss, but it's probably too much work for minor annoyance like this.

2 posts were split to a new topic: Pad with leading zeros and keep decimal places