# Math: Adding numeric tags to %\_max\_counter%

**URL:** https://community.mp3tag.de/t/math-adding-numeric-tags-to-max-counter/5502
**Category:** Export
**Created:** [September 27, 2007, 6:15pm UTC](https://community.mp3tag.de/t/math-adding-numeric-tags-to-max-counter/5502 "2007-09-27T18:15:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![supertagger](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@supertagger](https://community.mp3tag.de/u/supertagger)
#### Post date: [September 27, 2007, 6:15pm UTC](https://community.mp3tag.de/t/math-adding-numeric-tags-to-max-counter/5502/1 "2007-09-27T18:15:27Z")

</div>

Hi again,

thanks to Dano's input my script is almost complete. Currently output looks like this:

* * *

Day - 2007-09-25  
5 Albums | 1.54 GB | 54 Tracks

* * *

2007-09-25 - [Chanson] %artist% - %album% (1969) [FLAC|777kbps|443.84 MB|2 CDs|24 Tracks]  
2007-09-25 - [Pop] %artist% - %album% (1971) [FLAC|793kbps|275.04 MB|3 CDs|12 Tracks]  
2007-09-25 - [Folk] %artist% - %album% (1992) [FLAC|798kbps|357.62 MB|1 CD|9 Tracks]  
2007-09-25 - [Jazz] %artist% - %album% (1970) [FLAC|735kbps|231.11 MB|1 CD|5 Tracks]  
2007-09-25 - [Soul] %artist% - %album% (1969) [FLAC|841kbps|272.58 MB|1 CD|4 Tracks]

I am adding the %TOTALDISCS% tag to my albums ONLY if they have more than 1 disc. The rule for displaying the number of CDs in each line above goes like this:

IF %TOTALDISCS% is there, show it + CDs, else say 1 + CD

Is there a way to do a simple addition of the CD count even though I do not have a number of discs for single-disc albums?

It should look like this:

* * *

Day - 2007-09-25  
5 Albums | 1.54 GB | 8 CDs | 54 Tracks

* * *

My current calculation does not work:

$add($if(%TOTALDISCS%,%TOTALDISCS%,1),$if(%TOTALDISCS%,%TOTALDISCS%,1))

Idea is to use %TOTALDISCS% tag if it is there, else use '1' and add that to another album's %TOTALDISCS% tag OR '1'. And do that for all albums in this loop.

I can't seem to figure it out. Any help is greatly appreciated?

PS: Sorry, can't change the title anymore - I tried to work using the %\_max\_counter%, but that is not leading anywhere either... . 😕
