# \[X\] Problem with leading zeros in the TRACK tag

**URL:** https://community.mp3tag.de/t/x-problem-with-leading-zeros-in-the-track-tag/12964
**Category:** No Bugs
**Created:** [January 20, 2012, 12:07am UTC](https://community.mp3tag.de/t/x-problem-with-leading-zeros-in-the-track-tag/12964 "2012-01-20T00:07:59Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [January 20, 2012, 3:52am UTC](https://community.mp3tag.de/t/x-problem-with-leading-zeros-in-the-track-tag/12964/2 "2012-01-20T03:52:58Z")

</div>

> [@LikeYourStyle](#):
>
> ... I am creating a set of audio files with 3 digit track numbers in the file names. mp3tag creates ID3v2.3 tags with a track of 028, 029, 030, 031 etc. However, when I view these resulting tagged files in Windows Explorer and Windows Media Player the above track numbers are shown as 28, 29, 24, 25. So, Windows is interpreting tag 030 as 24 and tag 031 as 25. ... If I remove the leading zero by editing the file name, it solves the problem but that will cause my files to be displayed in the wrong order. ... It is clear to me that this leading zero in the actual tagged field is causing problems with the algorithm that windows uses to "calculate" the track numbers. ...For info, I am running Windows 7 Ultimate 64 bit.

We have already noted this phenomenon.  
[/t/11709/1](https://community.mp3tag.de/t/11709/1)

The problem seems not related to Mp3tag but to other software on the target system.  
Numbers resp. number strings (!), which contain only digits from 0 to 7 and begin with 0, are interpreted as octal numbers by the other software.  
Do deeper search into this direction.

The ID3 standard for ID3v2.3 and ID3v2.4 says:  
TRCK  
The 'Track number/Position in set' frame is a numeric string  
containing the order number of the audio-file on its original  
recording. This MAY be extended with a "/" character and a numeric  
string containing the total number of tracks/elements on the original  
recording. E.g. "4/9".

So the Mp3tag tag-field TRACK (ID3 TRCK) contains a 'numeric string', not an octal number.  
You can verify this with a hex editor for yourself.

> [@LikeYourStyle](#):
>
> ... Is it possible for you to strip leading blanks when converting the track number in the file name into the TRACK tag so that they are actually stored as 28, 29, 30 and 31. ...

Bewildering ... do you mean leading blanks or leading zeros?

Are you aware of the Mp3tag scripting functions?  
The $num(,) may be of help to format a number as needed.

DD.20120120.0552.CET

---

_[View the full topic](https://community.mp3tag.de/t/x-problem-with-leading-zeros-in-the-track-tag/12964)._
