docs: def to_reasonable_unit(value, units, round_digits=2):
      """Convert a value to the most reasonable unit.
  
      The most reasonable unit is roughly the one with the smallest exponent
      absolute value when written in scientific notation. For example
      `1.5` is more reasonable that `.0015` and `22` is more reasonable
      than `22000`. There is a bias towards numbers > 1, so `3.2` is
      considered more reasonable that `.32`.
      """
      def to_unit(unit):
          return float(value) / unit[1]
      exponents = [abs(Decimal(to_unit(u)).adjusted() - 1) for u in units]
      best = min(enumerate(exponents), key=itemgetter(1))[0]
      return dict(val=round(to_unit(units[best]), round_digits),
                  label=units[best][0],
                  multiplier=units[best][1])