code: def _format_quantum(val, unit):
      
      q=quantity(val,unit)
      if q.canonical().get_unit() in ['rad','s']:
          return quantity(val, 'm').formatted()[:-1]+unit
      else:
          return q.formatted()
docs: Format a quantity with reasonable units.
      :param val: The value (just the value, not a quantity)
      :param unit: Unit (something that can be fed to quanta).
      :return: A string representation of this quantity.
  
      >>> _format_quantum(3, 'm')
      "3 m"
      >>> _format_quantum(4914741782.503475, 's')
      "4.91474e+09 s"