Hi, im trying to achieve number format when user enter numeric value
currently its like 10000 i would like to have it as 10,000 . Pls advice. thanks
i manage to use function for the custom field but not sure about search field format.
I am not sure what you mean.
The Types Custom Field of type "number" only accepts dots, no commas.
We have some plans to enhance that, but for now this is the default and standard method.
For other formats you could use a Single Line field.
Does that suite your needs as well?
Hi Beda, thanks for replying over the weekend. Maybe i didn't explain clearly.
there is search box for price.
when i enter it display as usual 10000 . the price format is not there, i would like to have it such as 10,000 , the prefix i have no issue, but the number format i don't know how to achieve it.
my custom field has a function to display the price format , that looks good. but the front-end search form don't have similar format .
Please let me know if you still don't understand perhaps i can explain further. thanks
I udnerstand, but there is no inbuilt method to acheive that automaticallz, so let's say if a customer enters 10000, automatically it will create a query for 10,000.
This is not possible, how would you be sure the customer wants to search 10,000 and not 10000 or more complex?
You could try the filters of Views to modify that:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_custom_field_filter_original_value
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_custom_field_filter_processed_value
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_custom_field_filter_type
This is a allover Tutorial how to use filters and hooks in WordPress and Toolset:
https://toolset.com/documentation/programmer-reference/toolset-hooks/
Hi beda
This is not possible, how would you be sure the customer wants to search 10,000 and not 10000 or more complex?
This is a good question,
i don't expect them to enter 10,000 its just the value will be changed automatically when they enter , i believe its ajax ?
search queries that's another part i didn't think of .
I was hoping all number to be sync in format.
Then you need Custom JS Code that I cannot provide here.
The Filters I provided are for PHP; it would not change the visible Value on the fly.
If you are versed in JS, you might write your code for that, and insert it into the JS Section in the Filter Editor.
If you need custom assistance for that, I would suggest you consider contacting one of our certified partners from this link:
https://toolset.com/consultant/
You will get the custom assistance you need to get on with your project.
Thank you for understanding.
Thanks. may i know how do i add this code into it please.
where do i add the cdn for the js code versteckter Link
That is a JS Library.
You should create a Theme, enqueue that library and then use the JS in the JS editors of Views as example.