If you're trying to compensate volumetric gas flow measurement for temperature and pressure deviations from design conditions to get an inferred mass flow value, then the attached doc is working example from a single loop controller manual. It does not include a compressability factor.