# rand

Source: https://zotonic.com/docs/1309/rand

URI: https://zotonic.com/id/1309

Language: en



Generates a random number. The number is from, and including, 1 up to, and including, the input value.

Example:

```django
{{ 100|rand|format_integer }}
```

Might output “42”.

The rand filter can also generate a floating point value by given it a floating point number or a string representing a floating point number as input. It will generate a number from, but not including, 0 to, and including, the input value:

```django
{{ "4.0"|rand|format_number }}
```

Might output “3.1415926536”

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1309?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1309?language=en>)
