I jokingly made a vow. The story goes as follows: When my uncle’s child was born, he slaughtered a sheep as ‘Aqeeqah for the newborn and gave us a small share. Hence, I said: "If Allah Almighty granted me a child, I would slaughter a calf." Calves are very expensive here. What should I do? My financial situation does not allow me to buy a calf at the present time, and my wife is pregnant.
All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If one explicitly pronounces a vow, then his vow is considered binding, even if he was joking. Imaam An-Nawawi said: "The Shaafi‘i scholars said: 'Vows are considered valid only by uttering them, even without an intention, just like endowment and emancipation are valid by mere words even without intention.’”
Badr Ad-Deen Az-Zarkashi said in Al-Manthoor: "Some actions are considered effective even if the factor of the intention is missing, such as pronouncing divorce explicitly, emancipation, and vowing."
The statement that you uttered is indicative of a vow. The prominent scholar Al-Buhooti said:
If one makes the vow conditional on the presence of a blessing that he wishes for or on the averting of a distress that he fears, like by saying: "If Allaah Almighty heals my sick loved one or preserves my money, I will give such-and-such in charity," and then the conditioned matter occurs, then it becomes incumbent upon him to fulfill his vow, as stated by Imaam Ahmad.
Thus, if you are unable to fulfill the vow after your wife delivers her baby, then you should offer an expiation like that of breaking an oath. It was narrated on the authority of Ibn ‘Abbaas that the Prophet, sallallaahu ‘alayhi wa sallam, said: “If someone takes a vow but does not name it, then its expiation is the same as that of breaking an oath, and if someone makes a vow that he is unable to fulfill, then its expiation is the same as that of breaking an oath.” [Abu Daawood and Ibn Maajah] The narration of Ibn Maajah adds the following statement: "and if one takes a vow that he is able to fulfill, then he should fulfill it."
Allaah Knows best.
You can search for fatwa through many choices