Im also struggling to get comma separators working. I have no real experience with PHP. Im ok adding a snippet of code to the functions.php file on my child theme but can only copy and paste code there as i cant write or really understand php coding.
Anyway, i found this snippet of code which works perfectly fine, but, i can only get it to work using a single field and i have two pricing formats on my site i need to have working.
Can anyone tell me how to include another field name in this snippet so it still works?
add_filter(‘acf/format_value/name=rental_price’, ‘fix_number’, 20, 3);
function fix_number($value, $post_id, $field) {
$value = number_format($value);
return $value;
}
Ive tried, adding the other field name after rental price with a comma separating them and a space, without a space, adding additional ‘ before the next field, nothing seems to work.
Anyone working with a single price field this snippet works just fine. Unfortunately for me i need to use on two different price fields, rental_price and capital_price
Anyone that can help would be much appreciated.
I see some people have kindly offered some insight how to fix but for people like me who dont understand php the answers are a little too vague.
Thanks for your time