# values_sum proc

Source: https://ref.dm-lang.org/proc/values_sum
Added in BYOND 516.

### Format
> `values_sum(Alist)`

### Returns
> The sum of all associated numbers in Alist

### Args
> Alist: An [associative list](https://ref.dm-lang.org/list/associations.md) or [alist](https://ref.dm-lang.org/proc/alist.md)

Returns the sum of all associated values in this list that are numbers. Other values, including [vectors](https://ref.dm-lang.org/vector/index.md), are not summed.

```dm /values_sum/
var/list/weights = list(/obj/crate = 12, /obj/vase = 1)
usr << values_sum(weights)  // outputs 13
```

This is a convenience proc for games trying to eke out high performance.

If Alist is not an associative list, the result is 0.

### See also
- [list associations](https://ref.dm-lang.org/list/associations.md)
- [values_product proc](https://ref.dm-lang.org/proc/values_product.md)
- [values_dot proc](https://ref.dm-lang.org/proc/values_dot.md)
- [values_cut_over proc](https://ref.dm-lang.org/proc/values_cut_over.md)
- [values_cut_under proc](https://ref.dm-lang.org/proc/values_cut_under.md)
- [alist proc](https://ref.dm-lang.org/proc/alist.md)
