# round\_significant

Source: https://zotonic.com/docs/2330/round_significant

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

Language: en



Round a number value to a number of significant digits. The significance defaults to two digits.

Example:

```django
{{ 1256|round_significant }}
{{ 1256|round_significant:1 }}
{{ 1256|round_significant:3 }}
```

Results in:

```django
1300
1000
1260
```

Floating point values are also rounded to a number of digits. For example if `n` is set to `1256.78` then:

```django
{{ n|round_significant }}
{{ n|round_significant:3 }}
{{ n|round_significant:5 }}
```

Results in:

```django
1300.0
1260.0
1256.8
```

Input values that are not a number are converted to a floating point value. If the conversion fails then `undefined` is returned.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2330?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/2330?language=en>)
