Format custom field number

Content Views Pro helps you to show any WordPress custom fields (including ACF, Pods, Types…) easily.
You may need to format number (for example, show number in price format). To do it, please add this code to file functions.php of your active WordPress theme:

// Content Views Pro - format custom field number
add_filter( 'pt_cv_ctf_value', 'cvp_theme_ctf_format_value', 100, 3 );
function cvp_theme_ctf_format_value( $args, $key, $post ) {
	global $pt_cv_id;
	if ( $pt_cv_id == 'VIEW_ID' && $key == 'FIELD_NAME' ) {
		// Format the number
		$decimals	     = 0;
		$decimals_point	     = '.';
		$thousands_separator = ',';
		$formated_value	     = number_format( (float) $args, $decimals, $decimals_point, $thousands_separator );

		// Add "$" before number, add "USD" after number
		$args = sprintf( '$ %s USD', $formated_value );
	}

	return $args;
}

Please replace VIEW_ID with ID of your View, replace FIELD_NAME with name of your custom field.

Best regards,