# Pad with leading zeros and keep decimal places

**URL:** <https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361>\
**Category:** Support\
**Created:** [December 24, 2020, 2:08pm UTC](https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361 "2020-12-24T14:08:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lou2k7](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/8dc957/32.png) [@Lou2k7](https://community.mp3tag.de/u/Lou2k7)\
**Post date:** [December 24, 2020, 2:08pm UTC](https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361/1 "2020-12-24T14:08:21Z")

</div>

Is there a way to pad a zero and keep anything after the decimal?  
This is mainly for my audio books (Been getting short stories that fit in between other main books)  
SERIESNUM = 4.5  
$num(%seriesnum%,2) or $num(%seriesnum%,3)  
using the above will give me 04 or 004

I was hoping to get 04.5  
thank you.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [December 24, 2020, 10:32pm UTC](https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361/2 "2020-12-24T22:32:57Z")

</div>

SERIESNUM seems to be a user-defined field.  
So you have to take care of its format.  
the $num() function transforms a string into a number. MP3tag only deals with integers. So anything that is no number (here: the dot and following) will be cut off.

---

<div class="post-metadata">

**Author:** ![vilsen](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/e95f7d/32.png) [@vilsen](https://community.mp3tag.de/u/vilsen)\
**Post date:** [December 27, 2020, 2:11pm UTC](https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361/3 "2020-12-27T14:11:33Z")

</div>

You could setup this in an Action group:

> Format value  
> Field: TEMP  
> String: $regexp(%seriesnum%,\d+.,)

Then

> Format value  
> Field: SERIESNUM  
> String: $num(%seriesnum%,2).%temp%

Then remove the temp field.

---

<div class="post-metadata">

**Author:** ![Lou2k7](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/8dc957/32.png) [@Lou2k7](https://community.mp3tag.de/u/Lou2k7)\
**Post date:** [December 30, 2020, 8:21pm UTC](https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361/4 "2020-12-30T20:21:42Z")

</div>

Awesome. thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [January 29, 2021, 8:21pm UTC](https://community.mp3tag.de/t/pad-with-leading-zeros-and-keep-decimal-places/51361/5 "2021-01-29T20:21:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
