Hey everyone!

With the holiday season upon us, we want to share our upcoming working hours:

After that, we’ll return to our regular schedule and assist you as quickly as possible.

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.

Thanks a bunch for your understanding and support!

Warm regards and happy holidays!

TMS

Okay
  Public Ticket #2926436
Float filter not working
Closed

Comments

  •  1
    Against started the conversation

    Hi, I have set up a table with a Float column called "Cuota a Favor". I then created a Number range filter for this column in order for the table to show only the rows within a "Cuota a Favor" range.

    However, the filter only works when entering integer numbers. For example, when inputting From 2 To 5 it works ok, but inputting From 2.5 or 2,5 makes the table to show no results.

    On the other hand, this filter works as expected when I enable the option "Number range slider". The filter works correctly with decimals, but is a real pain to adjust the filter with this slider, at least in my dataset.

    I hope you can help me with this problem, as if I can't solve it, it will render the plugin unusable for my needs, and I have just purchased it.

  •  472
    Isidora replied

    Hi David,

    Thank you for your purchase.

    Sorry for the late response, we have some agents that have contracted Covid-19, so our team is cut in half.

    Yes you will need to use same Number format(that you set in Global settings) as in your source. If you still need that number format then you will need to make some changes in our plugin.

     In file wp-content/plugins/wpdatatables/source/class.wpdatatable.php around lines 2026 and 

    you will find this

    $left = str_replace(',', '.', str_replace('.',  '', $left));

    and you have to add comments like this

    //  $left = str_replace(',', '.', str_replace('.',  '', $left));

    also in same file around line 2035

    you will find this

    $right = str_replace(',', '.', str_replace('.',  '', $right));

    and you have to add comments like this

    //  $right = str_replace(',', '.', str_replace('.',  '', $right));

    Please note that will be overwritten in next update so you will need to do it again.

    Best regards.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

    You can try our wpDataTables add-ons before purchase on these sandbox sites:

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  •  1
    Against replied

    Hi Milan, thanks for your reply. I hope everyone is ok in your team.

    I don't really get this: "you will need to use same Number format(that you set in Global settings) as in your source."

    My table is created with a SQL query, and this column (Cuota a Favor) corresponds to a 'decimal(6,2) unsigned' column (Back_Odds) in my BBDD. In wpDataTables, I have set the data type for this column to Float, and the filter type to Number Range.

    I will happily change the data of any of the datasets if that would solve the problem, it is just that I don't see any incompatibility there. I'm sure I must be missing something here.

  • [deleted] replied

    Hi David

    I believe Milan was referring to the number format in wpDataTables main settings as displayed on the image below

    7163927879.png

    the values in the table need to be structured in the same way as they are in the source.

    Can you please change the number format and let us know if you still have the same issue. 

  •  1
    Against replied

    Oh god, finally working. Thanks a lot guys, this was driving me crazy. I thought that setting was for purely frontend "decorative" purposes

  •   [deleted] replied privately
  •  1
    Against replied

    Sure!

  • [deleted] replied

    Thank you!smile.png

    If there is anything else we can assist you with please don't hesitate to open a new ticket.

    Have a wonderful day!