Rounding
Lago aggregates your events in real time. You can add rounding rules to the final result.
Rounding options
When creating or editing a billable metric, you have the option to apply rounding to the final aggregated value. By default, no rounding is applied. If you choose to enable rounding, you can select from the following options:
- Ceil: Rounds up to the nearest integer;
- Floor: Rounds down to the nearest integer; or
- Round: Rounds to the nearest integer based on standard rounding rules.
Precision types
No precision
Omitting precision rounds to the nearest whole number (integer). By default, no specific precision is set for your rounding option.
π Example: 123.4567 rounded with no precision β 123
.
Positive precision
Adding a positive precision rounds to a specific number of decimal places.
π Example: 123.4567 rounded with precision 2 β 123.46
(two decimal places retained).
Negative precision
Adding a negative precision rounds to a specific position to the left of the decimal.
π Example: 123.4567 rounded with precision -1 β 120
(rounds to the nearest ten).
Was this page helpful?