code: def write_fix(self, time=None, latitude=None, longitude=None, valid=False,
                    pressure_alt=None, gps_alt=None, extensions=None):
          
  
          if time is None:
              time = datetime.datetime.utcnow()
  
          record = self.format_time(time)
          record += self.format_latitude(latitude)
          record += self.format_longitude(longitude)
          record += 'A' if valid else 'V'
          record += '%05d' % (pressure_alt or 0)
          record += '%05d' % (gps_alt or 0)
  
          if self.fix_extensions or extensions:
              if not (isinstance(extensions, list) and
                      isinstance(self.fix_extensions, list)):
                  raise ValueError('Invalid extensions list')
  
              if len(extensions) != len(self.fix_extensions):
                  raise ValueError(
                      'Number of extensions does not match declaration')
  
              for type_length, value in zip(self.fix_extensions, extensions):
                  length = type_length[1]
  
                  if isinstance(value, (int, float)):
                      value = ('%0' + str(length) + 'd') % value
  
                  if len(value) != length:
                      raise ValueError('Extension value has wrong length')
  
                  record += value
  
          self.write_record('B', record)
docs: Write a fix record::
  
              writer.write_fix(
                  datetime.time(12, 34, 56),
                  latitude=51.40375,
                  longitude=6.41275,
                  valid=True,
                  pressure_alt=1234,
                  gps_alt=1432,
              )
              # -> B1234565124225N00624765EA0123401432
  
          :param time: UTC time of the fix record (default:
              :meth:`~datetime.datetime.utcnow`)
          :param latitude: longitude of the last GPS fix
          :param longitude: latitude of the last GPS fix
          :param valid: ``True`` if the current GPS fix is 3D
          :param pressure_alt: altitude to the ICAO ISA above the 1013.25 hPa
              sea level datum
          :param gps_alt: altitude above the WGS84 ellipsoid
          :param extensions: a list of extension values according to previous
              declaration through
              :meth:`~aerofiles.igc.Writer.write_fix_extensions`