code: def format_numbers(number, prefix=""):
      
      # Matching
      r = re.match(r"^([-+]?\d*\.\d+|\d+)e([-+]?\d+)$", number)
  
      # Nothing matched
      if not r:
          if prefix != "":
              return "$" + prefix + number + "$"
          else:
              return number
  
      # Getting the coefficient and the exponent
      coefficient = r.group(1)
      exponent = int(r.group(2))
  
      return "$" + prefix + coefficient + r"\times 10^{" + str(exponent) + "}$"
docs: Formats number in the scientific notation for LaTeX.
  
      :param number: the number to format.
      :param prefix: a prefix to add before the number (e.g. "p < ").
  
      :type number: str
      :type prefix: str
  
      :returns: a string containing the scientific notation of the number.
      :rtype: str