---
title: "sum · RUAL Documentation"
description: "Returns the total sum of the given array of numbers."
canonical: https://docs.rual.nl/block-types/array/array_sum
language: en
---

# sum

This block is part of the [`array`](https://docs.rual.nl/block-types/array) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

Returns the total sum of the given array of numbers.

- Array required `array` The array of numbers for which to calculate the sum.

- Number `number` Sum of the array of numbers.

Returns the sum of the items coerced to numbers; numeric strings and booleans coerce, and non-coercible items after the first add 0. Outputs 0 when the array is empty, not an array, or its FIRST item is not numeric-coercible - indistinguishable from a real sum of 0.

| `total` |
| --- |

A typical wiring for [sum](https://docs.rual.nl/block-types/array/array_sum): the `number` out pin feeds [cast to value](https://docs.rual.nl/block-types/type%20casting/number_convert_to_value).

![Studio canvas example for the sum block: typical wiring for sum.](https://docs.rual.nl/canvas-examples/array_sum.png)

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
