Don't repeat yourself: Natural place for clculations on the FieldItemList of a custom FieldType wanted
The natural place would be a method in a custom field item list:

class MyFieldItemList extends FieldItemList {

  public function addAllNumbers() {
    $sum = 0;
    foreach ($this-&gt;list as $item) {
      $sum += $item-&gt;some_number;
    }
    return $sum;
  }

}


Set the list class in the field type:

 * @FieldType(
 *   ...
 *   list_class = "\Drupal\mymodule\MyFieldItemList",