Filter for a value that´s expressed as a fraction

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)
  • Anonymous
    #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
    #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.

    Anonymous
    #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
    #266875

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

    Anonymous
    #266904

    Thank you again Trevor.

    Trevor
    #266921

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

Viewing 6 posts – 1 through 6 (of 6 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.