# Add new column with file size

**URL:** https://community.mp3tag.de/t/add-new-column-with-file-size/50615
**Category:** General Discussion
**Created:** [October 27, 2020, 10:26pm UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615 "2020-10-27T22:26:52Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [October 27, 2020, 10:26pm UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/1 "2020-10-27T22:26:52Z")

</div>

In addition to the other columns, it would be useful to have a column with the file size of the file

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 27, 2020, 10:56pm UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/2 "2020-10-27T22:56:39Z")

</div>

Something like

| %\_file\_size% | File size in human readable format |
| --- | --- |
| %\_file\_size\_bytes% | File size in bytes |
| %\_file\_size\_kb% | File size in kilobytes |
| %\_file\_size\_mb% | File size in megabytes |

found in:

> **[File List – Mp3tag Documentation](https://docs.mp3tag.de/customization/file-list/)**
>
> Customization options for the File List, including adding, removing, hiding, and rearranging of columns. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [October 28, 2020, 12:58am UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/3 "2020-10-28T00:58:02Z")

</div>

You know, I must be getting old - I had added some custom/additional columns a long time ago, but I've been so happy with MP3Tag, I haven't felt the need to tweak it for a long time

Thanks for the reminder

Edit:

I'd like to format it to return 1,234.5 MB, but

$fmtnum($num(%\_file\_size\_mb%,1)) MB

drops the .5 part and only displays 1,234 MB

Is there a format that I can use?

---

<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: [October 28, 2020, 7:03am UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/4 "2020-10-28T07:03:28Z")

</div>

simply use %\_file\_size%, no special formatting.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 28, 2020, 8:31am UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/5 "2020-10-28T08:31:17Z")

</div>

I'm not sure if there is a formula for MB as you wish.  
I have created all 8 possible variants without and with $fmtnum and can't find your 1,234.5 format.  
(My windows system is using an apostrophe as thousands separator, not a comma).

From the [help](https://docs.mp3tag.de/scripting):

> $fmtNum(x) formats number x with separator for thousands according to current locale settings.

 ![Mp3tag $fmtnum](https://community.mp3tag.de/uploads/default/original/2X/e/e7ae44d55d8f8f88f2f725f64c347a124d2f811a.png)

Using very big numbers, $fmtnum seems to "shorten" the values: Please check the line with 11.82GB (shown as 11) and 26.54MB (shown as 26). **I can't say why the column with MB doesn't use a thousands separator at all and why the formatted MB doesn't show the numbers after the decimal separator.**

 ![Mp3tag $fmtnum big numbers](https://community.mp3tag.de/uploads/default/original/2X/c/c6745fa050421d1ea048731e48ffa621719ef057.png)

---

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [October 28, 2020, 3:29pm UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/6 "2020-10-28T15:29:11Z")

</div>

I went back to the 'basic' = **%\_file\_size\_mb% MB** , and then **$fmtnum(%\_file\_size\_mb%) MB**

The 'basic' displays as **1234.56 MB** and the other displays as **1,234 MB**

BTW, %_file\_size_% is smart (always 2 decimals though) but it adjusts to GB, MB, KB etc, I would prefer to keep the units consistent just to make it easier to review

I was trying to figure out how to get some of both:

the 1000's separator and only one decimal so that it would display as **1,234.5 MB**

I did try (from reading the manual) **$fmtnum($num(%\_file\_size\_mb%,1)) MB** but the $num() seems to be ignored (I was hoping I could fake it out)

It would seem to me that adding a second parameter to $fmtnum(x, y) where optional y (default = 0) is the number of decimals would be a nice feature to add

---

<div class="post-metadata">

### Author: ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)
#### Post date: [October 29, 2020, 4:49am UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/7 "2020-10-29T04:49:24Z")

</div>

> [@phossler](#):
>
> It would seem to me that adding a second parameter to $fmtnum(x, y) where optional y (default = 0) is the number of decimals would be a nice feature to add

Meanwhile, try this:  
`$fmtNum($div($add($div($mul(%_file_size_bytes%,100),1048576),5),100)).$div($right($add($div($mul(%_file_size_bytes%,100),1048576),5),2),10) MB`

---

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [October 30, 2020, 4:01am UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/8 "2020-10-30T04:01:26Z")

</div>

Thank you

That really works well

---

<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: [November 29, 2020, 4:01am UTC](https://community.mp3tag.de/t/add-new-column-with-file-size/50615/9 "2020-11-29T04:01:29Z")

</div>

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