Skip to content

Round to Significant Digits Filter

Rounds the value to the specified number of significant digits. Takes an integer from 1 to 6. It should be understood that the result of the rounding may not be exactly equal to the expected value, due to the limited precision of 32 bit floating point numbers, which makes some values unrepresentable.

# Example configuration entry
filters:
- round_to_significant_digits: 2
# 3.14159 -> 3.1
# 157079 -> 160000
# Example configuration entry
filters:
- round_to_significant_digits: 4
# 3.14159 -> 3.142
# 157079 -> 157100