---
title: "avg · RUAL Documentation"
description: "Returns the avarage number in the given array of numbers."
canonical: https://docs.rual.nl/block-types/array/array_avg
language: en
---

# avg

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 avarage number in the given array of numbers.

- Array required `array` Array with numbers.

- Number `number` The average number of the numbers in the given array.

Outputs the numeric sum of the array divided by the TOTAL item count. Emits 0 when the array is empty, missing, or its FIRST item is not numeric; later non-numeric items count as 0 yet still enlarge the divisor. Numeric strings and booleans coerce (true=1).

| `average` |
| --- |
| `mean` |

A typical wiring for [avg](https://docs.rual.nl/block-types/array/array_avg): 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 avg block: typical wiring for avg.](https://docs.rual.nl/canvas-examples/array_avg.png)

### Version history

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