docs: def quantize(number, digits=0, q=builtins.round):
      """
      Quantize to somewhere in between a magnitude.
  
      For example:
  
          * ceil(55.25, 1.2) => 55.26
          * floor(55.25, 1.2) => 55.24
          * round(55.3333, 2.5) => 55.335
          * round(12.345, 1.1) == round(12.345, 2) == 12.34
  
      """
      base, fraction = split(digits)
  
      # quantization beyond an order of magnitude results in a variable amount
      # of decimal digits depending on the lowest common multiple,
      # e.g. floor(1.2341234, 1.25) = 1.225 but floor(1.2341234, 1.5) = 1.20
      if fraction * 10 % 1 > 0:
          digits = base + 2
      else:
          digits = base + 1
  
      multiplier = 10 ** base * invert(fraction, default=1)
      quantized = q(number * multiplier) / multiplier
  
      # additional rounding step to get rid of floating point math wonkiness
      return builtins.round(quantized, digits)