Home › Forums › General Issues › 25.654628 to 25.65 Decimal Update › Reply To: 25.654628 to 25.65 Decimal Update
I think something like that should work:
function my_acf_format_value( $value, $post_id, $field ) {
$value = round($value, 2);
echo $value;
}
// Apply to fields named "my_field_name".
add_filter('acf/format_value/name=my_field_name', 'my_acf_format_value', 10, 3);
The filter “acf/format_value” give the ability to modify the value of a specific field (here by field’s name).
https://www.advancedcustomfields.com/resources/acf-format_value/
Hope this helps 😉
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.