Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Filter for a value that´s expressed as a fraction

Tagged: , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Mario Pérez
    #266823

    I´m trying to set-up a search form on custom posts using ACF.

    I have everything figured out except a tiny issue:

    I have a field for which the values are expressed as a fraction in numbers (i.e.: 1/10; 1/20; 1/70; etc.).

    I wanted to include a filter for this in the search form. I chose Number input type, Range – Slider (screenshot here: https://prnt.sc/vl2pn1).

    I´m not able to make it work. The search form filter shows a slider with only one value which is “1”.

    Can you give me some hint please on how I should go about this particular filter?
    Thanks,

    Trevor Moderator
    #266856

    Databases do not see fractions, such as those you mention, as numbers. The only valid characters allowed in a database number field are .0123456789 and \ is not allowed. Thus, the values (fractions) are being treated as text. Other than entering the fractions as decimals, I am not aware of a solution that could allow a slider.

    Mario Pérez
    #266867

    Thank you Trevor. This means, therefore, I cannot filter on this field right? Not even with a different type of filter (other than Slider)?

    Trevor Moderator
    #266875

    It will be OK as a Post Meta -> Choice field (and of any sub-type of that).

    Mario Pérez
    #266904

    Thank you again Trevor.

    Trevor Moderator
    #266921

    Thanks for getting back to me. I will close this thread for now.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Filter for a value that´s expressed as a fraction’ is closed to new replies.