Home › Forums › General Issues › Insert Commas into ACF number field › Reply To: Insert Commas into ACF number field
Hi,
I think this problem has been posted above by aimkbe but I couldn’t figure out the solution.
Below I have two numbers fields that I would like to add the comma to, when I add the first filter, it works perfectly but when I add the second it breaks the site, aimkbe says he solved the issue “I solved the issue… i used the same variable for both filters!”
I am not sure what I need to do to make this work. Any help would be appriciated. Thank you
add_filter(‘acf/format_value/name=rent_pcm’, ‘fix_number’, 20, 3);
function fix_number($value, $post_id, $field) {
$value = number_format($value);
return $value;
}
add_filter(‘acf/format_value/name=asking_price’, ‘fix_number’, 20, 3);
function fix_number($value, $post_id, $field) {
$value = number_format($value);
return $value;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.