valueTotal method

num valueTotal()

Get total value of list of num (int/double) 获取num列表的总值(int/double) Example: 1,2,3,4 => 10

Implementation

num valueTotal() {
  num total = 0;
  if (this == null || this.isEmpty) return total;
  if (this[0] is num) for (var v in this) total += v;
  throw FormatException('Can only accepting list of num (int/double)');
}