Forums Forums Search & Filter Pro Filter Numbers with thousand separator

Viewing 10 posts - 1 through 10 (of 38 total)
  • Trevor
    #246411

    You can display a number field with added formatting using PHP to convert the number to text, but it is not possible to range filter a field that already has that formatting, as it is, in effect, a text field and not a number field.

    It would be far better to store these as pure numbers, and use PHP to format them in the front end. But, if you don’t have this option, you would need two fields. It is possible to create PHP to automatically fill one field from the other when you save.

    Anonymous
    #246414

    Hi Trevor
    Thanks for your fast reply!
    Storing these as pure numbers and format them in the front end is what I tried before with ACF Support which wrote me this: “It has just come to my attention that this is a PHP limitation after several tests. It looks like the number field can only save decimals and not commas when using a float. Even though the data is updated, the comma will not be displayed and thus you will need to use a text field instead that returns a string. ”

    Because I dont know so much about PHP I dont know what would be the best to do now :,) .

    Trevor
    #246416

    Does your theme use a PHP template to display this page, and use PHP to output the number to the page?

    Anonymous
    #246421

    I use Divi theme and created a Child Theme to use PHP there but I have not added any php yet. Does this answer your question?

    Trevor
    #246425

    How do you tell Divi to output the ACF field on the page?

    Anonymous
    #246428

    For the cars page I used Elementor and there I have a text editor field with dynamic content that refers to the ACF field

    Trevor
    #246430

    Could you show me the code you use?

    Anonymous
    #246432

    I dont know which code you mean. Thats the page: https://autolocal.ch/vehicles/

    Trevor
    #246436

    What did you enter or type in to the Text Editor field?

    Anonymous
    #246440

    I used dynamic content (ACF Price Field) that is displayed in the Text Editor field. Just added a “CHF” before and ” .- ” after.

Viewing 10 posts - 1 through 10 (of 38 total)