---
title: std.atoi
summary: null
url: https://www.fastly.com/documentation/reference/vcl/functions/strings/std-atoi
---

```
INTEGER std.atoi(STRING s)
```

**Available in:** all subroutines

Takes a string (which represents an integer) as an argument and returns its
value. Behaves as if calling `std.strtol()` with
a base of 10.

## Example

```vcl
if (std.atoi(req.http.X-Decimal) == 42) {
  set req.http.X-TheAnswer = "Found";
}
```
