Perform math calculation in views
Interesting question and a typical use case. In a custom module, do the following:

use Drupal\views\ViewExecutable;

function helper_views_pre_render(ViewExecutable $view){
  if ($view-&gt;id() == "numbers" &amp;&amp; $view-&gt;current_display == 'page_1') {
    $total = 0;
    foreach ($view-&gt;result as $value) {
      $number = $value-&gt;_entity-&gt;get('field_number')-&gt;value;
      $total += $number;
    }
    $view-&gt;attachment_after = [
      '#markup' =&gt; '&lt;table class="table cols-0"&gt;&lt;tr&gt;&lt;td&gt;Total:&lt;/td&gt;&lt;td&gt;'.$total.'&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;',
      '#allowed_tags' =&gt; ['table','tr','td']
    ];
  }
}


Change the names according to your view name &amp; field names. I'm sure you get the point: you add a table below with the total result. 

I did a test and it gave me the following result: