code: def round_sf(number, digits):
      
      units = None
      try:
          num = number.magnitude
          units = number.units
      except AttributeError:
          num = number
  
      try:
          if (units != None):
              rounded_num = round(num, digits - int(floor(log10(abs(num)))) - 1) * units
          else:
              rounded_num = round(num, digits - int(floor(log10(abs(num)))) - 1)
          return rounded_num
      except ValueError:  # Prevents an error with log10(0)
          if (units != None):
              return 0 * units
          else:
              return 0
docs: Returns inputted value rounded to number of significant figures desired.
  
      :param number: Value to be rounded
      :type number: float
      :param digits: number of significant digits to be rounded to.
      :type digits: int