Honestly, I feel that's a personal choice. If you feel that Dilithium is something you don't get enough of and is too hard to come by then maybe you'd rather save it for something important. You can get perfectly good items by just spending Energy Credits, or by crafting them. Then again, there are some really good items that can be purchased only with Dilithium. If you don't mind putting in the work to get Dilithium to buy the item then by all means, do it.
If I have to make a quick estimate of a ratio I would say 50 or 100 energy credits to 1 dilithium. I never really looked into this so my numbers might be way off.
Really, it is just a matter of looking at each item, comparing their stats, and seeing which you like better.
I would like to add that from NPC stores, Mk XI items can only be purchased with Dilithium.
5 million to 50,000, It probably depends on if I have the 5 million or not. EC is junk, and not generally worth saving, so even at a poor trade I'd burn my EC before my dilithium.
On the other hand, that much EC will take more game time than 50k dilithium to actually collect. I won't delay purchases to get them with EC instead of dilithium.
I also feel that Energy Credits should be merged into the Dilithium system.
At least this would give more demand for Dilithium, if you can actually buy in-game items!
I disagree. Energy Credits are used for easily obtainable items. Dilithium is used for harder to find items. This is also why Dilithium is harder to get as compared to Energy Credits. If they were merged than everyone would be getting millions of Dilithium and could buy anything.
I could use an additional 200 million EC to buy a Jem'Hadar ship.
But I'd love to have some Dilithium to buy up DOffs when I get the chance.
It's really a matter of what you need at any given time. But personally, I'd say EC, because it's easier to earn and more versatile a currency than Dilithium. Dilithium's also more valuable and it's good to save it for the really valuable, one of a kind items. EC's more of a staple currency.
Kinda like comparing dollar bills to gold. Everyone lusts for gold, but try paying for your groceries with a Gold Krugerrand.