| 1 |
--- |
| 2 |
title: math.Add |
| 3 |
description: Returns the result of adding one or more numbers to the first number. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
aliases: [add] |
| 9 |
returnType: any |
| 10 |
signatures: [math.Add VALUE VALUE...] |
| 11 |
--- |
| 12 |
|
| 13 |
If one of the numbers is a [`float`](g), the result is a `float`. |
| 14 |
|
| 15 |
```go-html-template |
| 16 |
{{ add 12 3 2 }} → 17 |
| 17 |
``` |
| 18 |
|
| 19 |
You can also use the `add` function to concatenate strings. |
| 20 |
|
| 21 |
```go-html-template |
| 22 |
{{ add "hu" "go" }} → hugo |
| 23 |
``` |