Support

Account

Home Forums General Issues Formatting number fields using format_value Reply To: Formatting number fields using format_value

  • Hi John,

    Thank you very much for kindly getting back to me!
    I just figured it out by a piece of code that works:

    add_filter('acf/format_value/name=listing_price', 'fix_number', 10, 3);
    function fix_number($value, $post_id, $field) {
    $value = number_format($value);
    return $value;
    }
    

    I wanted to format the front-end display!

    Now I just have to input the prices again of over 100 listings:-) But at least they display correctly!
    I wonder why this isn’t a default setting of ACF and a piece of code is needed to be displayed properly?

    Thank you very much for your time!