Support

Account

Home Forums ACF PRO Insert dots and $ sign if is a number Reply To: Insert dots and $ sign if is a number

  • 
    if ( have_rows( 'valores' ) ) :
    	while ( have_rows( 'valores' ) ) : 
    		the_row();
    		$value = get_field('valor1');
    		if ($value == intval($value)) {
    			$value = '$'.number_format(intval($value, ',', '.'));
    		}
    		echo $value;
    		$value = get_field('valor2');
    		if ($value == intval($value)) {
    			$value = '$'.number_format(intval($value, ',', '.'));
    		}
    		echo $value;
    	endwhile;
    endif;