Problem:
The essence of this thread is to ask if it is possible to have a number separator for the number fields, example having 1000 in the format 1,000 with a comma as a separator
Solution:
Unfortunately not, since the number field can only handle numbers and no string elements then it is not possible natively.
However through some javascript this becomes possible, this means that the javascript will reformat the strings for you on the frontend.
You simply need to add this code that the customer shared to your view javascript section.
function numberWithCommas(x) { return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ","); } $('.price').each(function(){ var v_pound = $(this).html(); v_pound = numberWithCommas(v_pound); $(this).html(v_pound) })
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 6 replies, has 2 voices.
Last updated by SadeghH4619 8 years ago.
Assisted by: Shane.