---
schema_version: "1"
id: 5d7a4d6f6e543dcbf3a61ad948a46e2ccee57f1bfdd8eeaa36295957769dbbad
title: abs
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-core-functions-abs.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-core-functions-abs
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8230df7a5e8f409b7e90364909814ab775af87865d632719edf66a242f6d5a9e
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

# abs

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## abs(number: Number): Number

Returns the absolute value of a number.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>number</code></p></td><td><p>The number to evaluate.</p></td></tr></tbody></table>

### Example

This example returns the absolute value of the specified numbers.

#### Source

```DataWeave
%dw 2.0
output application/json
---
[ abs(-2), abs(2.5), abs(-3.4), abs(3) ]
```

#### Output

```JSON
[ 2, 2.5, 3.4, 3 ]
```
