powered by
Computes a sensible number of decimal digits to round time horizons based on the minimal positive separation between unique finite times.
determine_round_digits(times)
Integer number of digits between 0 and 6.
Numeric vector of times.
Uses the smallest strictly positive difference among sorted unique finite times, then returns ceiling(-log10(min_diff)) truncated to \([0, 6]\).
ceiling(-log10(min_diff))
# Not run: determine_round_digits(c(0.1, 0.12, 0.125)) NULL
Run the code above in your browser using DataLab