libb.round_to_nearest

round_to_nearest(value, base)[source]

Round value to nearest multiple of base.

Parameters:
  • value (float) – Value to round.

  • base – Base multiple to round to (must be >= 1).

Returns:

Rounded value.

Return type:

float

Example:

>>> round_to_nearest(12, 25)
0
>>> round_to_nearest(26, 25)
25