Problem: How should I save and display currency values effectively?
Solution:
Enter numbers using "point" for decimals. Commas are not currently supported here.
1.00 10.99 1000.00 ...and so on...
Sorting works automatically when numbers are entered in this format. Filtering numbers with decimals effectively requires a small code change. This code change is described here:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_custom_field_filter_type
Click "+ More" to see an example.
To show the currency, hard-code it into the display of a field. The currency type does not get stored in the database with the value, so sorting and filtering continues to work as expected. Example:
€[wpv-post-field name="my-price-slug"] $[wpv-post-field name="my-budget-slug"]
In the field description for each custom field, you can add a note that tells the user which currency should be used. This will show up in the admin editor area for your post.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_custom_field_filter_type
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 7 years, 5 months ago.
Assisted by: Christian Cox.