It is narrated from Muhammad bin Ka'b al-Qurazi (may Allah have mercy on him) that Sayyiduna Ali (may Allah be pleased with him) said: "I have seen myself with the Messenger of Allah (peace and blessings be upon him) in such a state that I would tie a stone over my stomach from the severity of hunger, and today the charity (sadaqah) from my wealth is forty thousand."
I am not certain that Muhammad bin Ka'b heard from Sayyiduna Ali (may Allah be pleased with him); Yazid bin Ziyad narrates from Muhammad bin Ka'b (may Allah have mercy on him) that he said: "Someone who heard Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) narrated to me that he said: I went out of my house hungry" (the hadith).
Related hadith on this topic