Agni Purana, Chapter 245 describes the story of Nandaka sword as:
Lord Brahma performed a sacrifice on the banks of celestial Ganges on the peaks of the Meru (mountain). When he was contemplating at the sacrifice he saw the demon Loha (that causes) obstruction. As he was thinking about that, a great mighty form appeared from the fire in front of him. He bowed down to the lord (Brahma) and the celestials greeted him with joy. Lord Hari took the sword (called) Nandaka from the demon as requested by the celestials. The lord seized it slowly and it became unsheathed. The sword was blue (in colour) with gem (studded) handle. Then the demon became (endowed with) hundred hands. That demon mad the celestials run away in the battlefield by means of the mace. the body of the demon was cut by lord Hari with the sword and (the parts of) the body fell on the earth and all of them became pieces of iron on account of their contact with the (sword) Nandaka. After having killed him lord Hari gave him a boon (saying) "Your holy body would become (the material) for weapons on the earth."
Hindi translation is trying to say that the great mighty form which appeared from the fire is known as Nandaka.
Now, I have found the good translation of story which is:
The god bowed down to Brahman and all the gods humbled themselves before him as well. The god Hari took the sword Nandaka from the hands of Fire-god, and the whole haven was jubilant.