# GREATER THAN not recognizing decimal

**URL:** https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952
**Category:** Support
**Created:** [December 24, 2024, 6:43pm UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952 "2024-12-24T18:43:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![esumsea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/esumsea/32/7219_2.png) [@esumsea](https://community.mp3tag.de/u/esumsea)
#### Post date: [December 24, 2024, 6:43pm UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/1 "2024-12-24T18:43:27Z")

</div>

Hello,

Back to working on these files again. I really should force myself to do some work on it every month or so, so I don't forget so much. Anyhow...

I was using the filter and I tried to find files with %rating% GREATER 2  
The results brought me everything with a 3 rating of greater, but does not find files rated with 2.5, which is obviously greater than 2. So, it seems this filtering function either does not recognize the use of the decimal or I have to write the filter some special way.

Any ideas on a workaround.

---

<div class="post-metadata">

### Author: ![rboss](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@rboss](https://community.mp3tag.de/u/rboss)
#### Post date: [December 25, 2024, 1:30am UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/2 "2024-12-25T01:30:41Z")

</div>

The filtering function does not recognize decimal numbers.

From the [filter documentation page](https://docs.mp3tag.de/filter/):

```auto
 <field> GREATER <number>

### <field> LESS <number>

### <field> EQUAL <number>

Returns all files where the content of tag field named `<field>` is greater, equal, or less that the integer value specified by `<number>`.

```

Number must be an integer; i.e a number without a fractional or decimal part.

Would something like

> "$if($strcmp($replace(%rating%,',',,'.',), **324** ),1,0)" IS 1

suit your needs?

This would take any decimal number (say, 3,24 or 3.24) from `%rating%`, remove its divider character (comma, period, etc.) and compare it to the integer version of said number (324 in this example); on a positive match the function would return 1, and match the filter expression.

---

<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 25, 2024, 8:07am UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/3 "2024-12-25T08:07:44Z")

</div>

> [@esumsea](#):
>
> So, it seems this filtering function either does not recognize the use of the decimal or I have to write the filter some special way.

Yes. After a short glance at the documentation this should not have been a surprise. And as the experienced MP3tag and forum user that you are, I would have assumed that you use that source of information first.

As filter you could try  
`"$replace(%rating%,.,)" GREATER 2`

---

<div class="post-metadata">

### Author: ![esumsea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/esumsea/32/7219_2.png) [@esumsea](https://community.mp3tag.de/u/esumsea)
#### Post date: [December 27, 2024, 2:00am UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/4 "2024-12-27T02:00:56Z")

</div>

> [@ohrenkino](#):
>
> "$replace(%rating%,.,)" GREATER 2

I looked but did not see where it said you could not use a decimal.

Unfortunately, assuming I know anything is a bad assumption. 🙂 I wish I could claim otherwise but that which I think I know, I often forget. 😆 But I did try to figure it out, unfortunately, I failed. Thanks for the suggestions and clarifications. I will try your filter, but I can't seem to figure out how to apply your tips.

I guess I could just use 1-10 rating system.

---

<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: [December 27, 2024, 7:20am UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/5 "2024-12-27T07:20:18Z")

</div>

> [@esumsea](#):
>
> I looked but did not see where it said you could not use a decimal.

As rboss already quoted from the [help](https://docs.mp3tag.de/filter/#field-greater-number):

 ![image](https://community.mp3tag.de/uploads/default/original/3X/7/5/75b98e830926c41ed46d904d59107ca3c2fe9f80.png)  
An "integer" in computer science means digits/numbers without decimal places.

---

<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: [December 27, 2024, 7:26am UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/6 "2024-12-27T07:26:06Z")

</div>

> [@esumsea](#):
>
> I will try your filter, but I can't seem to figure out how to apply your tips.

Press F3 to activate the filter.  
Copy & paste  
`"$replace(%rating%,.,)" GREATER 2`

This command will replace all dots in the field `%rating%` with nothing.  
So your 2.5 becomes 25 and is therefore greater then 2 and therefore appears in your filtered list of files with a rating greater then 2.

---

<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 27, 2024, 8:05am UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/7 "2024-12-27T08:05:55Z")

</div>

> [@esumsea](#):
>
> I guess I could just use 1-10 rating system.

I wonder why you don't use [POPULARIMETER](https://docs.mp3tag.de/mapping/#popularimeter) and its rules but a user-defined field instead which is probably not read by a lot of players and comes with the additional drawback of having non-integer values.

BTW, my assuption about utilizing the documentation as you mentioned it in 2020

> [@Technique for tagging classical music for itunes using grouping and movements for proper shuffling](https://community.mp3tag.de/t/technique-for-tagging-classical-music-for-itunes-using-grouping-and-movements-for-proper-shuffling/47593/3):
>
> Thanks again ohrenkino! I am confused as I see WORK (%work%) in Tag fields exclusive to MP4 in [Tag Field Mappings – Mp3tag Documentation](https://docs.mp3tag.de/mapping) Since the only field mapping I did was the one above for ID3v2, do I have to do additional mapping or will I be fine with both MP4 and ID3v2 if I just use CONTENTGROUP (%contentgroup%) for work title?

---

<div class="post-metadata">

### Author: ![esumsea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/esumsea/32/7219_2.png) [@esumsea](https://community.mp3tag.de/u/esumsea)
#### Post date: [December 31, 2024, 11:53pm UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/8 "2024-12-31T23:53:58Z")

</div>

> [@LyricsLover](#):
>
> > [@esumsea](#):
> >
> > I will try your filter, but I can't seem to figure out how to apply your tips.
> 
> Press F3 to activate the filter.  
> Copy & paste  
> `"$replace(%rating%,.,)" GREATER 2`
> 
> This command will replace all dots in the field `%rating%` with nothing.  
> So your 2.5 becomes 25 and is therefore greater then 2 and therefore appears in your filtered list of files with a rating greater then 2.

Ah, now I get it! Thanks man, this could work!

---

<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 30, 2025, 11:54pm UTC](https://community.mp3tag.de/t/greater-than-not-recognizing-decimal/66952/9 "2025-01-30T23:54:05Z")

</div>

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