Support

Account

Home Forums General Issues Insert Commas into ACF number field Reply To: Insert Commas into ACF number field

  • To keep the decimals and add (2 decimal points if there are none), you need to change
    $value = number_format($value);
    $value = number_format($value , 2);

    add_filter(‘acf/format_value/name=instrument_price’, ‘fix_number’, 20, 3);
    function fix_number($value, $post_id, $field) {
    $value = number_format($value , 2);
    return $value;
    }

    see https://www.php.net/manual/en/function.number-format.php