Support

Account

Home Forums General Issues How to display addition/ sum of number field, in repeator? Reply To: How to display addition/ sum of number field, in repeator?

  • I tried this

    <?php
    $total = 0;
    while(the_repeater_field(‘information’ )):
    the_sub_field(‘amount_paid’ );
    $total += intval( get_sub_field(‘amount_paid’ ) );
    endwhile;
    echo $total;
    ?>
    But its showing all numbers together, not as total!
    It gave me output as 1000012707, should be 10000+12707