# Changing track number format from x/y to x

**URL:** https://community.mp3tag.de/t/changing-track-number-format-from-x-y-to-x/13556
**Category:** General Discussion
**Created:** [June 18, 2012, 5:30am UTC](https://community.mp3tag.de/t/changing-track-number-format-from-x-y-to-x/13556 "2012-06-18T05:30:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pjetson](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pjetson](https://community.mp3tag.de/u/pjetson)
#### Post date: [June 18, 2012, 5:30am UTC](https://community.mp3tag.de/t/changing-track-number-format-from-x-y-to-x/13556/1 "2012-06-18T05:30:52Z")

</div>

For quite some time, I've been "annoyed" by the variations of track number formats in my MP3 files. Some have just digits (my preference), some have leading zeros, some have x/y, and so on. I haven't been able to come up with an easy way to change them. Until now!

V2.51's **Convert Tag-Tag** function works a treat, but it took a little while to work out how to do it.

Just set the FIELD set to **TRACK** , and the FORMAT STRING to **$add(%track%,0)**

I hope this helps someone else.

Regards,  
Peter

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [June 18, 2012, 7:01am UTC](https://community.mp3tag.de/t/changing-track-number-format-from-x-y-to-x/13556/2 "2012-06-18T07:01:52Z")

</div>

There is a dedicated function for track number formatting which should be used:

$num(%track%,1)

---

<div class="post-metadata">

### Author: ![pjetson](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/f6c823/32.png) [@pjetson](https://community.mp3tag.de/u/pjetson)
#### Post date: [June 18, 2012, 8:25am UTC](https://community.mp3tag.de/t/changing-track-number-format-from-x-y-to-x/13556/3 "2012-06-18T08:25:05Z")

</div>

Hi, Dano. **$num** is not a dedicated function for track numbering, it's a general purpose function for turning a number into a string with leading zero padding to the specified number of digits. It can't do what I wanted to do.

The **$add** function works (as far as I can tell) because it converts the existing track number string into an integer, which effectively drops any zeros before the number, and any non-numeric characters after the track number. It then adds the second argument (in my proposal a zero) to the track number, then converts it back to a string. That's exactly the function that I required to standardise my track numbers, and I thought it may be useful to others.

Regards, Peter

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [June 18, 2012, 10:54am UTC](https://community.mp3tag.de/t/changing-track-number-format-from-x-y-to-x/13556/4 "2012-06-18T10:54:44Z")

</div>

Why not? $num also deals with the x/y format:  
$num(5/9,1) =\> 5
