The electrical construction firm E.C. Ernst Inc. has posted its first quarterly profit since Dec. 1, 1978, when the firm filed for protection under the federal bankruptcy act.

The company reported a profit of $14.97 million on volume of $17.19 million for the first quarter of fiscal 1981 ended June 30. Most of that profit reflected extraordinary income -- a gain from divestiture of L.K. Comstock & Co. Inc., whch Ernst traded to Chitibank in return for forgiveness of $11.8 million in debts.

No comparable figures for the same quarter in fiscal 1980 were provided nor were per-share earnings.

Without the earnings from that item, net income was $3.16 million. Most of that was attributable to cash collected from claim awards won in connection with projects that pre-dated the filing under federal bankruptcy laws. Ernst does not record claims until they are received.

In the fiscal year ended March 31, Ernst lost $12.86 million on a volume of $72.17 million. The loss brought the company's total loss over four years to $66 million.

"Things are better than they were," said Joseph E. Griffin, chairman and chief executive officer of Ernst.

Griffin said that "Every project award to Ernst since management acted to protect the company under Chapter XI has been operating at a profitable or break-even rate."

Among the company's continuing problems, he said were severe credit restrictions and no bonding until August 1979.

The company's operations have been restructured from 17 branches to five regional units located in Washington, Philadelphia, Atlanta, Pittsburgh and Norfolk, Va. Griffin also said that the five new units "are set up to undertake major electrical construction projects through the eastern United States."

Giant Food Inc. yesterday announced a decrease in net income for the 24 weeks ended Aug. 9 of 38 percent compared with the period ended Aug. 11, 1979. Net income was $4.852 million (99 cents per share) compared with $7.860 million ($1.57) a year before.

Giant blamed the downturn in earnings in part on Giant's 22-week freeze on the prices of about 400 private label products an selected meat and dairy items. The freeze covered all but one of the most recent 12 weeks covered by the report, said a spokesman.

Sales were $636.525 million compared with $542.131 million, an increase of 17.4 percent.

Sales in the 12 weeks ended Aug. 9 were $322.55 million compared with $273.62 million a year before, an increase of 17.9 percent. Net income was $1.51 million, down 57 percent from $3.53 in the previous year.