For companies yes, for currencies not so much!
Number of coins x value of the coin. Easy
There is no such thing as a market cap for a currency. That is comparing apples to oranges.
Bitcoin and crypto are most certainly NOT money. They are digital assets, but not currencies.
Anyway, call them what you will - but the money supply anyway is not the same as market cap.
Say there are $100 trillion in existence. Is the market cap of dollars $100 trillion? No- because new money can be created via loans or credit without the need to 'print'. Is $100 trillion the size of the U.S. economy or the GDP? Also certainly not, dollars get used more than once (velocity) - you spend $1 to buy a pack of gum, the gum seller uses it to buy an apple, the apple seller uses it to buy a coffee etc.
As for commodity assets you can't actually say what is the market cap of oil, for instance. That is an absurd question to ask in the first place. One can estimate the current market value of all the oil ever produced, or yet to be produced but that is not a market capitalization.
Bitcoins are NOT shares of ownership in the Bitcoin ecosystem or anything else. Having $100 in your wallet does not give you ownership of America. Having 100 shares of Apple DOES give you ownership of Apple, Inc. however tiny.
Bitcoin has value and a market price, but it is incorrect to try to value a digital asset the same was one would value a company (shares of stock), bonds (debt), or foreign currency. FX is governed in the long-run by pricing parity principle (PPP) and via arbitrage through covered and via theory by uncovered interest rate parity.