GREATER THAN not recognizing decimal

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.

The filtering function does not recognize decimal numbers.

From the filter documentation page:

 <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.

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

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

Unfortunately, assuming I know anything is a bad assumption. :slight_smile: I wish I could claim otherwise but that which I think I know, I often forget. :laughing: 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.

As rboss already quoted from the help:


An "integer" in computer science means digits/numbers without decimal places.

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.

I wonder why you don't use 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

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